Pretty new to angular so maybe I'm missing something obvious. I have a model with collection of objects with own properties; and I'm trying to create a csv value out of Text property of that object. I've tried few things and got it to work with both ng-repeat and by calling a function. However what I thought was the most straight forward way of doing this is not quite working.
{{item.Keywords.map(function (kw) { return kw.Text; }).join(', ')}}
In this example join works just fine (i see object separated by commas), however when combined with map it's unable to interpret it and just prints out it as is. Is there a trick to using map that I'm missing?
Angular expressions can't do everything you can do in javascript. Check out the angular docs for expressions for more detail on what they can and can't do. I don't think you can declare a function in an angular expression so that is probably why your particular example is not working.
In general you should try to keep the logic in a view to a minimum. You can always just move the logic from your expression into a function on the controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With