directive
Match mode restrict: ' AEMC ' defaults to a
Template
Templateurl
Templatecache: Cache The template with a number of instructions.
var mymodule = Angular.module ("MyModule", []); // when the syringe has loaded all modules, this method performs a Mymodule.run (function($templateCache) { $templateCache. Put (" Hello.html "," <div>hello everyone!!!!!! </div> ");}); Mymodule.directive (function($templateCache) { return { ' AECM ', Template: $templateCache. Get ("hello.html"), true }} );
Replace
Transclude: directives nested with each other
Independent scope
scope:{}
var mymodule = Angular.module ("MyModule", []); Mymodule.directive (function() { return { ' AE ', scope:{}, ' <div><input type= ' text ' ng-model= "UserName"/>{{username}}</div> ', true }});
Binding policy
Built-in instruction 63:
Compile&&link:
Load Angular.js, locate the NG-APP directive, determine the application boundary
Traverse Dom to find all instructions
Convert the DOM structure based on the template,replace,transclue of the instruction code
Connection phase
Run the link function for each instruction
The link function is typically used to manipulate the DOM and bind event listeners.
angularjs-Command command