December 2014
Intermediate to advanced
272 pages
8h 17m
English
You implement custom directives by calling the directive() method on a Module object. The directive() method accepts the name of a directive as the first parameter and a provider function that returns an object containing the necessary instructions to build the directive object. For example, the following is a basic definition for a directive:
angular.module('myApp', []). directive('myDirective', function() { return { template: 'Name: {{name}} Score: {{score}}' }; });
Table 7.1 provides a list of the properties you can apply to the object returned by the directive definition as template is returned in the preceding code.
Table 7.1 Directive Definition ...
Read now
Unlock full access