美文网首页
radio类型的ng-model

radio类型的ng-model

作者: 仁安天下 | 来源:发表于2019-10-13 01:26 被阅读0次

    radio类型的ng-model,必须是object.object($scope.email_type.email_type),否则会是undefined

    <div style="text-align: center">
        <div style="width: 15%;display: inline-block">
            <input  name="email" type="radio" ng-model="email_type.email_type" ng-checked="true"  value="type_1"/><span>通知</span>
        </div>
        <div style="width: 15%;display: inline-block">
            <input  name="email" type="radio" ng-model="email_type.email_type"  value="type_2"/><span>提醒</span>
        </div>
        <div style="width: 15%;display: inline-block">
            <input name="email" type="radio" ng-model="email_type.email_type"  value="type_3"/><span>通报</span>
        </div>
        <div style="width: 15%;display: inline-block">
            <input name="email" type="radio" ng-model="email_type.email_type"  value="type_4"/><span>周期通报</span>
        </div>
    </div>
    $scope.email_type={
        email_type:""
    };
    
    

    相关文章

      网友评论

          本文标题:radio类型的ng-model

          本文链接:https://www.haomeiwen.com/subject/efqhmctx.html