angular 自定义指令
2014-02-17 11:32
232 查看
1:首先获取module对象 var myAppModule = angular.module('myApp', []);
2:定义指令 my.directive('myPlanet', [
function myPlanetDirectiveFactory() {
return {
restrict : 'E',
scope : {},
link : function($scope, $element) {
$element.text("我是自定义的指令! ');
}
}
} ]);
3:使用:
<my-planet>sdfdsf</my-planet>
2:定义指令 my.directive('myPlanet', [
function myPlanetDirectiveFactory() {
return {
restrict : 'E',
scope : {},
link : function($scope, $element) {
$element.text("我是自定义的指令! ');
}
}
} ]);
3:使用:
<my-planet>sdfdsf</my-planet>
相关文章推荐
- angular自定义指令scope属性学习笔记
- -_-#【Angular】自定义指令directive
- angular 自定义指令 link or controller
- Angular自定义指令简单实例
- angular 权限控制 service+ 自定义指令(改写ngIf)
- 第216天:Angular---自定义指令(二)
- Angular开发(十二)-自定义指令
- angular 自定义指令 Directive(详解)
- Angular 自定义指令
- angular自定义指令templateUrl
- angular 自定义指令参数详解
- angular 自定义指令详解 Directive
- Angular自定义指令
- Angular自定义指令(directive)
- angular 自定义指令参数详解
- Angular 自定义指令详解
- 一,Angular自定义指令
- Angular 学习笔记——自定义指令
- 11-Angular的自定义指令以及实例
- Angular自定义指令(初级)