directive is undefined ,是我的angularJs下錯了?
下面是main.js
angular.module("myApp",[])
.controller('SignUpController',function($scope){
?$scope.userdata = {};
?$scope.submitForm = function(){
??console.log($scope.userdata);?
??if ($scope.signUpForm.$invalid)
???alert('請檢查您的信息');
??else
???alert('success');
?};
})
.directive('compare',function(){
?var o ={};
?o.strict = 'AE';
?o.scope = {
??orgText :'=compare'
?};
?o.require = 'ngModel';
?o.link = function(sco,ele,att,con){
??con.$validator.compare = function(v){
???return v == scope.orgText;
??};
??sco.$watch('orgText',function(){
???con.$validate();
??})
?};
})
2016-10-24
return o;
2016-09-27
return v == scope.orgText; ? ?這個應該是單等
2016-09-26
應該是代碼哪里錯了T T,我所有版本都換了一遍,都是這個錯