Skip to content

ui-view inside a directive that does ng-tranclude does not work #774

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
gampleman opened this issue Jan 17, 2014 · 11 comments
Closed

ui-view inside a directive that does ng-tranclude does not work #774

gampleman opened this issue Jan 17, 2014 · 11 comments

Comments

@gampleman
Copy link

See this plunkr.

This code should load up the content of the template inside the panel. It doesn't. This is a regression in 0.2.8.

<body ng-app>
    <panel><ui-view></ui-view></panel>
</body>
angular.module('Test', ['ui.router']).config(['$stateProvider', '$urlRouterProvider',
  function($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.when('/', '/boarding').otherwise('/');
    $stateProvider.state('boarding', {
        template: '<h2>Boarding</h2><panel><ui-view></ui-view></panel>',
        url: '/{path:.+}'
      });
  }]).directive('panel', function() {
    return {
      restrict: 'E',
      transclude: true,
      template: '<div ng-transclude></div>'
    };
  })
@nateabele
Copy link
Contributor

Thanks for the simple reproduce code. I'm looking into it and will hopefully be able to patch it soon.

@mlegenhausen
Copy link

+1

@gamb
Copy link

gamb commented Feb 15, 2014

+1 ..and, in case it helps, i'm pretty sure this happened in 'v0.2.7-dev-2014-02-13' (a402415), but I haven't had time to investigate the code yet.

@timkindberg
Copy link
Contributor

Yea its the new anchor placeholder stuff that went in that you see on lines 76-77 of viewDirective.js. I'm pretty sure we took that right from ngView or something though so we're not sure why it broke so much stuff.

@mehradoo
Copy link

what is the status of this issue? I faced the same problem #907 and want to know which version doesn't have this transclude issue. I have no problem using an older version of ui-router as long as it can let my custom tab directive work

@ndhoule
Copy link

ndhoule commented Feb 24, 2014

@mehradoo: The 0.2.7 release isn't affected by this issue. (It was introduced in the revision noted above by @gamb.)

@mehradoo
Copy link

@ndhoule Thanks Nathan, I confirm that 0.2.7 doesn't have this issue:
http://plnkr.co/edit/u2LE7gFUGSpAmUNK3fhP?p=preview

@gampleman
Copy link
Author

Seems to be fixed by #858.

@corbanbrook
Copy link

Confirmed it fixes the issue. Sorry about other messages, havent had my morning coffee yet eek.. :\

@gkohen
Copy link

gkohen commented Apr 2, 2015

Does it make sense to write a test spec for such a case ? Let me know if you want one.

@nateabele
Copy link
Contributor

@gkohen Never gonna say no to more tests. 👍 Have at it.

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

9 participants