Tuesday, January 14, 2014

Three properties are exposed in AngularJS templates without annotations.

They are:

  1. $scope holds stuff, and by stuff I mean data. Annotations such as ng-repeat and ng-show get full access to $scope and depend upon it for their mechanics.
  2. $id is a unique id for the current scope, and I mean $scope by scope.
  3. $window is the AngularJS way to do the stuff you do with window.whatever in JavaScript. It may be stubbed in testing.

 
 

Other properties such as $index which depends upon $ng-repeat are tied to a specific annotations and are used within an annotation and are not standalone "entities" themselves.

No comments:

Post a Comment