角度指令

时间:2017-07-24 11:00:45

标签: angularjs

我正在尝试使用自定义指令并获取错误 无法找到指令'ngChange'所需的控制器'ngModel'!

这很奇怪,因为我正在使用ng-model指令:

<input type="password" same-as ng-model="confirmPassword" />

app.ns('rm.ng.controllers', function ($root, $ns) {
    this.MyCTR= function (scope, myService) {
        scope.confirmPassword = '';
    };
});


app.ns('rm.ng.directives', function ($root, $ns) {
    this.sameAs = function ($parse, $compile, myService) {
        this.restrict = "A";
        this.link = function (scope, element, attrs) {
            console.log("asdfasdfasdf");
        };
    };
});

0 个答案:

没有答案