“AngularJS way” to map values for output in a view
问题 Am seeking advice on a beginner problem with AngularJS: My app has lots of cases where the API it's working with gives a value from a list of possible types, I've pulled the value into my model and then I want to map it to something, eg icons for each type. As I'm likely to be re-using the mapping of a few of these common types quite frequently, what's a good way to do this that is efficient and allows re-use? I'm trying to keep it "DRY" and stick to the "Separation of concerns" so the