I use angular ngTagsInput and my list is like:
[{text: "4353453"}, {text: "453453"}, {text: "4534534"}, {text: "5345"}]
And change it with array map like below code :
var array = [{text: "4353453"}, {text: "453453"}, {text: "4534534"}, {text: "5345"}];
var new_array = array.map(function(item) {
return parseInt(item.text);
});
When i use this code in my angular controller i got an error like :
TypeError: Cannot read property 'map' of undefined
at new <anonymous> (CustomerPageController.js:208)
at Object.instantiate (angular.js:4619)
at angular.js:9870
at ui-bootstrap-tpls.min.js:8
at angular.js:15552
at m.$eval (angular.js:16820)
at m.$digest (angular.js:16636)
at m.$apply (angular.js:16928)
at g (angular.js:11266)
at t (angular.js:11464)
How can i fix it?