AngularJS Examples

Be sure to check out AngularJS: A 10,000 Word Guide and also AngularJS In One Day for the full demonstration, explanations, and examples.

The list below is the result of ng-repeat looping through and displaying an array:

The list below is from the same data as above. However it uses limitTo to gather only the first 3 items and then uses orderby to display these first 3 items in reverse alphabetical order.

Display the current array length with .length

{{ main.items.length }} in stock

Displaying the date with formatting

Today's date: {{ timeNow | date:'fullDate' }}

This example uses | uppercase

This pipe capitalizes the entire input: {{msg | uppercase}}

This example uses a filter to display only the numbers larger than the input

This example uses the directives ng-show and ng-click to Toggle the text below