Input Radio with default value

1

Using Asp.Net MVC 5 with AngularJS I want a input radio to be checked by default.

According to the link:

How to select a radio button by default?

Assign an initial value to radio button as checked

Just use this:

<label class="btn btn-default">
    <input type="radio" ng-model="ViewBag.Imposto.calcular" value="false">
    Não
</label>
<label class="btn btn-default">
    <input type="radio" ng-model="ViewBag.Imposto.calcular" value="true" checked="checked">
    Sim
</label>

But it is not working, how to solve this?

Edited

With can be seen in the image, even using the above code the option is not checked.

    
asked by anonymous 10.03.2015 / 20:26

1 answer

1

I think you have to use the Angular API - ng-checked , and input < in> checked with

ng-checked="true"
    
10.03.2015 / 21:48