Having trouble with ng-repeat in AngularJS, only showing first element and getting a console error:
Expected expression in form of '_item_ in _collection_[ track by _id_]' but got 'âpm'.
angular.module('DataCabinet')
.controller('IdeCtrl', ['$scope', 'ProjectService', 'authentication', 'notification', '$location', '$timeout', '$sce',
function ($scope, ProjectService, authentication, notification, $location, $timeout, $sce) {
ProjectService.projectRead().then(function(data) {
var projectArray = JSON.parse(data.data);
console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
console.log(projectArray);
vm["projectRead"] = projectArray;
// vm["prModel"] = projectArray;
console.log(vm);
});
}
]);
JSON data :
{"projectRead":[{"ProjectName":"W23","ProjectType":"Jupyter IPython","PythonVersion":null,"_id":"59a0af89e1fbd208fbafe2b8","ProjectCreatedInNfs":"true"},{"ProjectName":"W33","ProjectType":"Jupyter IPython","PythonVersion":null,"_id":"59a0c37b8092720b60e10493","ProjectCreatedInNfs":"true"}]}
<div ng-controller="IdeCtrl">
<ul>
<li ng-repeat= " pm in vm.projectRead ">{{pm}}</li>
</ul>
</div>