0
即使在单击checkbox
后,下面的代码始终为returns false
。我的领导告诉我,ngmodel
可能没有适当的与国家挂钩。我是新来的角度,可能有人请帮助我angular - 即使复选框已选中,此声明字段始终为假
HTML:
<form-checkbox
required="true"
set-checkbox-touched="DeclarationRequest.declarationAgree"
servervalidate="DeclarationRequest.declarationAgree"
name="declarationAgree" id="declarationAgree" class="form-checkbox" ng-model="ctrl.checkbox.myFlag">I have read and agree to the terms above.</form-checkbox>
JS:
(function(module){
'use strict';
module.directive('Declaration', function() {
return {
templateUrl: '/client/Purchase/components/declaration/declaration.template.html',
restrict: 'E',
scope: {
declarationAgree: '='
},
bindToController: true,
controllerAs: 'control',
controller: 'DeclarationController'
};
});
function DeclarationController() {
}
module.controller('DeclarationController', DeclarationController);
DeclarationController.$inject = [];
})(angular.module('Purchase'));
你可以把你的$ scope对象放在问题中吗? – Jai
@Jai:更新了队友,但我认为在这里提供解决方案或解决方案并不相关。但是,你走了,看看,让我知道什么是错的? – Learner
你的代码“总是返回false”...从哪里? – iulian