ng-model changes of type in radio button
问题 Please note this example: JSFiddle Sample <div ng-controller="myCtrl"> var ng-model = {{myValue}} - {{myType}} <input type="radio" value="true" name="boolean" ng-change="logIt()" ng-model="myValue" /> True <input type="radio" value="false" name="boolean" ng-change="logIt()" ng-model="myValue" /> False </div> var myApp = angular.module('myApp',[]); function myCtrl($scope) { $scope.myValue = true; //does not work //$scope.myValue = 'true'; //it does work $scope.myType =(typeof $scope.myValue);