There's a very powerful command system in Angularjs.such as built-in directives: Ng-app,ng-model,ng-repeat,ng-init,ng-bind, etc.from now on, we'll explain ANGULARJS custom instructions .
first, let's take a look at the new definition of a directive in Angularjs:
Newsapp.directive (' newdirective ', function () {
return {
priority:0,//Priority
Template: ",
Templateurl: ',//Introduce template link
Replace:false,//Replace
Transclude:false,//whether to retain the original content
Restrict: ' E ',//E C A M
Controller: ',//or function () {}
Scope:false,//true or {}
Require: ['? Ngmodel '],//dependencies
Compile:function compile (telement, Tattrs, transclude) {
return {
Pre:function prelink (Scope, ielement, Iattrs, Controller) {
},
Post:function Postlink (Scope, ielement, Iattrs, Controller) {
}
}
},
Link:function Postlink (Scope, ielement, iattrs) {
}
}
});
For these parameters of the directive we are distributed to explain the course catalogue:
- Section First: Priority,template,templateurl
- Section II: REPLACE,TRANSCLUDE,RESTRICT
- Section III: Controller,scope
- Section Fourth: Require,ngmodel
- Section Fifth: Compile
- Section Sixth: Link
ANGULARJS Instruction System Series course (1): Catalogue