I have this array stateData.submenu :
[
{
"template": "<span translate>myContacts</span>",
"sref": "contact.list"
},
{
"template": "<span translate>myProjects</span>",
"sref": "project.list"
},
{
"template": "<span translate>myRecommendations</span>
<span class=\"badge\">{{ notificationBadge }}</span>",
"sref": "recommendation.list"
}
]
I would like to interpolate all template properties with the service $interpolate
I can interpret a single property for example with :
this.notificationBadge = this.$interpolate(stateData.submenu[2].template)(this)
How can I loop and interpolate all the properties using ecmaScript 2015 or Lodash for example ?
this.notificationBadge = this.$interpolate(stateData.submenu)(this)to know thatsubmenuis a array$interpolatecompiles a string with markup into an interpolation function, it can't work with array. What template are you expecting as a result?