I want to wrap some ui-view elements inside a custom angularjs directive
<wrapper>
<ul>
<li><a ui-sref="route1">Route 1</a></li>
<li><a ui-sref="route2">Route 2</a></li>
</ul>
<div class="well" ui-view="viewA"></div>
<div class="well" ui-view="viewB"></div>
</wrapper>
The custom directive does nothing but transcluding the content:
myapp.directive('wrapper', function($compile){
return {
restrict: 'E',
replace: true,
transclude:true,
template: '<div class="godWrapper" ng-transclude></div>'
};
});
See the demo in Plunker
It seems that ui-view doesn't like to be wrapped as when I remove the wrapper element the demo works with no problem. Is this a bug in ui-router or am I doing something wrong?
UPDATE:
Apparently this is a known issue. Issue 774 and Issue 886