如果它有一个句点,我将如何传回这个参数?

时间:2014-03-09 19:01:59

标签: javascript angularjs

控制器不接受传回给它的期间。那么我如何传回参数required_doc.completion_status

<a ng-class="completion_status(required_doc.completion_status)">
    {{required_doc.completion_status}}% Complete
</a>
$scope.completionClass = function(required_doc.completion_status) {
    if(required_doc.completion_status == 100)
        return "success"
    else
        return "failure";
};

1 个答案:

答案 0 :(得分:0)

你不应该在函数的参数名称中添加一个点:

$scope.completionClass = function(status) {
    if(status == 100)
        return "success"
    else
        return "failure";
};