I am trying to use an array.map function in my ng-click expression:
addTracksToPlaylist(album.tracks.items.map(function(o){return o.id}));
but I am getting a syntax error Token '{' is unexpected, expecting [)] at column 47 of the expression
. I don't really know what to do about this, I'm trying not to put the function in the scope or outside of my markup.
angular
expression which is a subset of javascript. otherwise script injection would be too easy. You'll have to settle for a function in your controller that returns the filtered array. You can create a$filter
and use it instead. – Muli Yulzary Aug 7 at 20:24