Tutorial by Examples

1) Use ng-repeat sparingly Using ng-repeat in views generally results in poor performance, particularly when there are nested ng-repeat's. This is super slow! <div ng-repeat="user in userCollection"> <div ng-repeat="details in user"> {{details}} </div...
Angular has reputation for having awesome bidirectional data binding. By default, Angular continuously synchronizes values bound between model and view components any time data changes in either the model or view component. This comes with a cost of being a bit slow if used too much. This will hav...
AngularJS has digest loop and all your functions in a view and filters are executed every time the digest cycle is run. The digest loop will be executed whenever the model is updated and it can slow down your app (filter can be hit multiple times, before the page is loaded). You should avoid this: ...
Watchers needed for watch some value and detect that this value is changed. After call $watch() or $watchCollection new watcher add to internal watcher collection in current scope. So, what is watcher? Watcher is a simple function, which is called on every digest cycle, and returns some value. An...
These functions are very similar in behaviour. The difference is that ng-if removes elements from the DOM. If there are large parts of the code that will not be shown, then ng-if is the way to go. ng-show will only hide the elements but will keep all the handlers. ng-if The ngIf directive removes ...
<div ng-controller="ExampleController"> <form name="userForm"> Name: <input type="text" name="userName" ng-model="user.name" ng-model-options="{ debounce: 1000 }" /> ...
You must always unregister scopes other then your current scope as shown below: //always deregister these $rootScope.$on(...); $scope.$parent.$on(...); You don't have to deregister listners on current scope as angular would take care of it: //no need to deregister this $scope.$on(...); $r...

Page 1 of 1