Adding numbers: {{1 + 2}}
Adding strings: {{"Hi" + " there"}}
From scope in controller: {{event.name}}
Syntax: {{input | filtername}}
Filter uppercase: {{event.name | uppercase}}
Filter decimals: {{5 | number:3}} and {{1.2345 | number:2}}
Filter currency: {{2 | currency}}
For debugging, use the json filter: {{ {a:3,b:'hi', c:{a:35} } | json }}
(For custom filters, se below.)
ng-non-bindable makes it possible to write angular syntax without evaluating the expression:
Use {{ ...}} to evaluate angular expression
External link with ng-href: Click to follow link
ng-show and ng-hide: Reads the boolValue from scope in controller. (Change boolValue to toggle the text):
ng-show using property from scope
ng-hide using property from scope
Use ng-disabled and property from scope to disable button:
Use ng-src to prevent loading to early:
ng-app: Defines the angular application.
ng-controller: Defines the controller.
ng-submit Makes it possible to call a function in the controller and pass in the info that should be submitted. (See Review submit button in Gem Store for example)
ng-model binds the value of the HTML controls (input, textarea, select) to the appliction data.
ng-bind binds the application data to the HTML view. It is equivalent to the {{}}
Use ng-class to style with info from myclass:
Styled with myclass
Use ng-style to style with info from mystyle:
Text styled with mystyle.
Combine ng-style with event.name from controller/scope:
Style comes from ng-style. event.name shows here: {{event.name}}>
Combine ng-style with ng-bind event.name:
Duration: {{session.duration | duration}}
{{session.description}}