You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, the poster of #49 had the same question, but the issue was closed without solving the original poster's issue of using the $scope.object.map functionality.
This is for the example where each object in the array has both an "id" and "text" field:
The error I'm receiving when clicking my "Check All" button for "id only" check all is the following:
TypeError: Cannot read property 'map' of undefined' at Scope.$scope.checkAll (file.js xx:xx)
I'm especially facing this issue when the "id" primary key of my object isn't simply id, but instead something like bookId.
Haven't been able to find the underlying issue for the last few days, wondering if someone is using the $scope.object.map function and facing a similar issue.
The text was updated successfully, but these errors were encountered:
Actually, the poster of #49 had the same question, but the issue was closed without solving the original poster's issue of using the $scope.object.map functionality.
This is for the example where each object in the array has both an "id" and "text" field:
$scope.roles = [
{ id: 1, text: 'guest' },
{ id: 2, text: 'user', },
{ id: 3, text: 'customer' },
{ id: 4, text: 'admin' }
];
The original poster must use the $scope.object.map function in order to just return the id only (or whichever array you're using for your data source:
$scope.checkAll = function() {
$scope.user.roles = $scope.roles.map(function(item) { return item.id; });
};
The error I'm receiving when clicking my "Check All" button for "id only" check all is the following:
TypeError: Cannot read property 'map' of undefined'
at Scope.$scope.checkAll (file.js xx:xx)
I'm especially facing this issue when the "id" primary key of my object isn't simply id, but instead something like bookId.
Haven't been able to find the underlying issue for the last few days, wondering if someone is using the $scope.object.map function and facing a similar issue.
The text was updated successfully, but these errors were encountered: