是这样的,我才开始学习angular,但是没弄明白angular中input的value与ng-modal的关系
当我的input标签的value不是数据中的值时他就不会被选中。
这是html:<div class="form-group">
<label for="" class="col-sm-2 control-label">类型</label>
<div class="col-sm-10 ">
<label class="radio-inline">
<input type="radio" ng-model="v.type" value="click"> 关键词
</label>
<label class="radio-inline">
<input type="radio" ng-model="v.type" value="view"> 链接
</label>
</div>
</div>这是angular:$scope.data = {
"button":[
{
"type":"click",
"name":"今日歌曲",
"key":"V1001_TODAY_MUSIC"
},
{
"type":"view",
"name":"菜单",
"url":"http://www.soso.com/",
"sub_button":[
{
"type":"view",
"name":"搜索",
"url":"http://www.soso.com/"
},
{
"type":"view",
"name":"视频",
"url":"http://v.qq.com/"
},
{
"type":"click",
"name":"赞一下我们",
"key":"V1001_GOOD"
}
]
}
]
}
当我的input标签的value不是数据中的值时他就不会被选中。
这是html:<div class="form-group">
<label for="" class="col-sm-2 control-label">类型</label>
<div class="col-sm-10 ">
<label class="radio-inline">
<input type="radio" ng-model="v.type" value="click"> 关键词
</label>
<label class="radio-inline">
<input type="radio" ng-model="v.type" value="view"> 链接
</label>
</div>
</div>这是angular:$scope.data = {
"button":[
{
"type":"click",
"name":"今日歌曲",
"key":"V1001_TODAY_MUSIC"
},
{
"type":"view",
"name":"菜单",
"url":"http://www.soso.com/",
"sub_button":[
{
"type":"view",
"name":"搜索",
"url":"http://www.soso.com/"
},
{
"type":"view",
"name":"视频",
"url":"http://v.qq.com/"
},
{
"type":"click",
"name":"赞一下我们",
"key":"V1001_GOOD"
}
]
}
]
}
我不知道你的value值是干什么的