Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular pipe first letter uppercase

{{ value_expression | titlecase }}
Comment

angular pipe to capitalize first letter

transform(value:string): string {
  let first = value.substr(0,1).toUpperCase();
  return first + value.substr(1); 
}
  
Comment

angular capitalize first letter

content_copy
@Component({
  selector: 'titlecase-pipe',
  template: `<div>
    <p>{{'some string' | titlecase}}</p> <!-- output is expected to be "Some String" -->
    <p>{{'tHIs is mIXeD CaSe' | titlecase}}</p> <!-- output is expected to be "This Is Mixed Case" -->
    <p>{{'it's non-trivial question' | titlecase}}</p> <!-- output is expected to be "It's Non-trivial Question" -->
    <p>{{'one,two,three' | titlecase}}</p> <!-- output is expected to be "One,two,three" -->
    <p>{{'true|false' | titlecase}}</p> <!-- output is expected to be "True|false" -->
    <p>{{'foo-vs-bar' | titlecase}}</p> <!-- output is expected to be "Foo-vs-bar" -->
  </div>`
})
export class TitleCasePipeComponent {
}
Comment

method for convert first letter in uppercase in angular

app.filter('capitalize', function() {
  return function(token) {
      return token.charAt(0).toUpperCase() + token.slice(1);
   }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert mongodb timestamp to date javascript 
Javascript :: server.js 
Javascript :: add item to array in javascript 
Javascript :: javascript log to console 
Javascript :: java script remove last character from string 
Javascript :: react-native razorpay 
Javascript :: javascript reset span html 
Javascript :: javascript browser tab active 
Javascript :: javascript arithmetic operators 
Javascript :: how to run commands in the command prompt using javascript 
Javascript :: forjs check if key in json 
Javascript :: Easy Way to Check if 2 Arrays are Equal in JavaScript 
Javascript :: javascript bigint 
Javascript :: node print variable 
Javascript :: default selected radio button angular material 
Javascript :: js get element by index 
Javascript :: or inside if javascript 
Javascript :: offsetheight javascript 
Javascript :: js remove html element 
Javascript :: how to change background color though props 
Javascript :: how to get checked value of checkbox in jquery 
Javascript :: as it does not contain a package.json file. react 
Javascript :: before page load javascript 
Javascript :: how to reference the bot joining a server in discord.js 
Javascript :: create app with a specific react version 
Javascript :: json data 
Javascript :: npm error Could not resolve dependency peer react@"^18.0.0" from react-test-renderer@18.0.0 
Javascript :: react bootstrap add progress bar 
Javascript :: array filter 
Javascript :: change navigation animation react native 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =