June 2014
Intermediate to advanced
696 pages
38h 52m
English
You can include AngularJS template code to build view components that will be displayed in the HTML element that contains the directive. You can add template code directly by using the template property, as in this example:
directive('myDirective', function() { return { template: 'Name: {{name}} Score: {{score}}' };});
You can specify a root element in the custom template—but only one element. This element acts as the root element for any child element defined in the AngularJS template to be placed inside. Also, if you are using the transclude flag, the element should include ngTransclude. For example:
directive('myDirective', function() { return ...
Read now
Unlock full access