【发布时间】:2017-03-16 00:02:13
【问题描述】:
当我尝试将 Angular js 与语义 ui 集成时遇到问题(数据绑定不起作用),特别是当我使用如下代码之类的单选按钮字段时:
html
<div ng-controller="MyCtrl">
<div class="ui form">
<div class="field">
<div class="ui radio checkbox">
<input type="radio" ng-model="value" value="foo" ng-change="newValue(value)">
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" ng-model="value" value="boo" ng-change="newValue(value)">
</div>
</div>
</div>
{{value}}
</div>
和控制器
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.value= 'foo';
$scope.newValue = function(value) {
console.log(value);
}
}
【问题讨论】:
标签: angularjs radio-button semantic-ui