Oranq 2016-05-31
为了让AngularJS能够调用我们的指令,需要修改指令定义中的restrict设置。这个设置告诉AngularJS在编译HTML时用那种声明格式来匹配指令定义,我们可以指定一个或者多个格式
元素(E)、属性(A)、类(C)、注释(M)
angular.module('myApp', [])
.directive('myDirective', function() {
return {
restrict: 'EAC',
replace: true,
template: '<a href="http://google.com">Click me to go to Google</a>'
};
}); 问题描述在编写导入指令的时候,需要将函数绑定到指令中,并传入一个参数。<button ng-hide="importing" class="btn btn-warning btn-sm" type="