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 ?