Notes and Examples on AngularJS




Say hello to:

Hello, {{name1}}!


Say hello to:

Hello, {{getName()}}!



Remaining: {{remaining()}} characters

------------------------------------------------------

------------------------------------------------------

Secret Shown!

------------------------------------------------------

Secret Hidden!

------------------------------------------------------

Secret is now showing.
Won't show you any of my secrets!

------------------------------------------------------


Name e-mail
{{user.name}} {{user.email}}
{{user.desc}}

Filtering by string expression

Name Description Priority Estimation Done?
{{item.name}} {{item.desc}} {{item.priority}} {{item.estimation}} {{item.done}}
Total: {{filteredBacklog.length}}

Filtering by object expression

Name Description Priority Estimation Done?
{{item.name}} {{item.desc}} {{item.priority}} {{item.estimation}} {{item.done}}
Total: {{filteredBacklogObj.length}}

DI using inline array annotation

	var app = angular.module("DemoApp", []);
	// Controller is injected with $scope and $http as dependencies
	app.controller('DemoController', ['$scope', '$http', function (s, h) {
		h.get('https://api.github.com/users/angular/repos')
        	.success(function (repos) {
        		s.repos = repos;
    	});
	}]);
		
<body ng-app="DemoApp" ng-controller="DemoController"> <h3>Angular Github Repositories</h3> <ul> <li ng-repeat="repo in repos"> <a ng-href="((repo.html_url))"> ((repo.name)) </a> </li> </ul> </body>