I am trying to target dynamic named views in an ng-repeat but can't do so at config phase as views can only be named statically. Is there a way imitate url param matching like '/path/:param'
but with view names like views: {'path:param': {...}}
?
I've tried modifying the state config object at run()
to see if changing state configuration after config()
had any effect:
rootScope.$on('$stateChangeStart', function(e, to, toP, from, fromP) {
//nope
if(toP.itemId) {
to.views['item-'+toP.itemId+'@home'] = to.views['item-:itemId@home'];
delete to.views['item-:itemId@home'];
}
}
plunker: http://plnkr.co/edit/ZkrteD1ls71yd5V10Xub?p=preview