Angular.JS中的指令引用template与指令当做属性详解
一、引用template 对于指令,可以把它简单的理解成在特定DOM元素上运行的函数,指令可以扩展这个元素的功能。 指令要生效,那么html头里面要 <html lang="en" ng-app="app"> 制定ng-app的值和定义指令的module名字一致: angular.module('app',[]) 指令的完整参数: angular.module('myApp', []) .directive('myDirective', function() { return { restrict: String, priority: Number, termina
下载地址
用户评论