angularjs单选按钮值检查

时间:2015-09-19 13:06:28

标签: javascript angularjs

当我选择单选按钮时没有任何反应。请chk我的jsfiddle并帮助我找到我做错了什么。

var prnt = document.getElementById("prnt");
var app = angular.module('App', []);
app.controller('aCtrl', function($scope) {
$scope.correctAns = function(){
if($scope.chk === "false"){
prnt.innerHTML+="working";

};
};

});

这是我的jsfiddle链接

http://jsfiddle.net/rushdi1987/4d4tbext/5/

1 个答案:

答案 0 :(得分:0)

这是你想做的吗?

var prnt = document.getElementById("prnt");
var app = angular.module('App', []);
app.controller('aCtrl', function ($scope) {

    $scope.chk = {
        val: false
    };

    $scope.check = function () {
        if ($scope.chk.val === false) {
            prnt.innerHTML = "True";
        }
    }
});