HTML如下:
买家
卖家
Javascript中创建了directive:
(function(){
angular.module('homeRegister',[
'ui.router'
]).directive('homeRegister',function(){
return {
templateUrl:'/frontend/components/modal-home/home-register/home-register.html',
controller:homeRegister
}
});
function homeRegister($scope,$http,$timeout,Flash,FormFilter){
$scope.regForm={
type:'buyer',
};
$scope.goLogin=function(){
$timeout(function() {
$scope.$parent.isLogin = true;//父scope中
},0);
};
}
打开页面后点击radio没有效果。加了name属性,试了ng-value也都不行。
求各路大神帮忙解决一下。。。多谢!
2016/6/11 22:10更新:
试了一下,我的这个是加载在一个模态框上的。当点击其中一个radio,再关闭模态框,然后再呼出模态框后,发现就选中了。估计是angular视图渲染方面的问题,也请各位大神帮忙解答一下,多谢了~
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
从代码里没看出来
regForm.type在哪里定义的而且
name属性在你的case里应该是必须的,即便加了也没能矫正你现在遇到的问题,也应该加上(因为错误还在其他地方,不能因为加上name没修正现在的错误就不加)