Skip to content

ui-view doesn't work when used inside angularjs custom directives #907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mehradoo opened this issue Feb 24, 2014 · 1 comment
Closed

ui-view doesn't work when used inside angularjs custom directives #907

mehradoo opened this issue Feb 24, 2014 · 1 comment

Comments

@mehradoo
Copy link

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: http://plnkr.co/edit/bNb2q8KV1u6cgKgTyODo?p=preview

It seems that ui-view doesn't like to be wrapped as when I remove the wrapper element the demo works with no problem.

source: http://stackoverflow.com/questions/21994715/ui-view-doesnt-work-when-used-inside-angularjs-custom-directives

@timkindberg
Copy link
Contributor

I think this is a duplicate of #774

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants