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