【发布时间】:2016-04-07 15:33:25
【问题描述】:
指令用法
<my-directive my-attr='StackOverflow'></my-directive>
指令定义
app.directive('myDirective', function($scope){
return {
restrict: 'E',
template: 'I want to print the attribute value',
controller: function($scope){
// I also want to access the attribute value here.
}
};
});
有没有办法做到这一点。
【问题讨论】:
标签: angularjs angularjs-directive