以下脚本正在运行
angular.module('myApp').directive('validNumber',[function(){
return{
require:'ngModel',
scope:{},
link: function (scope ,element, attr, ngModel) {
}
}}]) //here is my html <input ng-model="data" valid-number>
以下脚本无法正常工作原因?它会抛出编译错误缺少必需的控制器
angular.module('myApp').directive('validNumber',[function(){
return{
require:'ngSandy',
scope:{},
link: function (scope ,element, attr, ngModel) {
}
}}]) //here is my html <input ng-sandy="data" valid-number>