获取ngRepeat错误(错误:ngRepeat:iidexp无效标识符)

时间:2016-03-06 21:32:50

标签: javascript angularjs angularjs-ng-repeat ng-repeat

enter image description here

控制器代码:

shows

这是来自usersList的1个用户对象:

function usersView() {
    var directive = {
        templateUrl      : "users/users.html",
        restrict         : "E",
        replace          : true,
        bindToController : true,
        controller       : UsersCtrl,
        controllerAs     : 'usrs',
        link             : link,
        scope            : {}
    };
    return directive;
    function link(scope, element, attrs) {}
}

//....

initUsersDirect();

function initUsersDirect() {
    ApiFactory.getUsers().success(function(data) {
        vm.usersList = data.users;
        displayUsersList();
        console.log('vm.usersList',vm.usersList);
    });
}

function displayUsersList() {
    vm.usersLoaded = true;
}

标记:

{
    active: 1
    firstname: "Alexander"
    id: 1345324526
    lastname: "Finkle"
    role_id: 4
    session: Object
    username: "stackoverflow@gmail.com"
}

知道我为什么会收到此错误?的 Error: ngRepeat:iidexp Invalid Identifier

1 个答案:

答案 0 :(得分:3)

标记应为:

accept()