Skip to content
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

<div app-view-segment="1"></div> does not work inside ng-if #56

Closed
IKoshelev opened this issue Aug 1, 2014 · 4 comments
Closed

<div app-view-segment="1"></div> does not work inside ng-if #56

IKoshelev opened this issue Aug 1, 2014 · 4 comments

Comments

@IKoshelev
Copy link

Good day again, Artem.

We have a nested route where we only want to load segments after the first if the first one successfully loaded data. We are using resolve:{...} in the route and in the template of first segment:

<div ng-if="group"> 
     <div app-view-segment="1"></div>
</div>

It doesn't work - the element gets added to the DOM, but the segment doesn't show up inside it.

We found a workaround like this

    <script type="text/ng-template" id="app-view-segment1.html">
         <div app-view-segment="1"></div>
    </script>

   <div ng-if="group"> 
        <div class="span10 early-full-width">
              <div ng-include=" 'app-view-segment1.html' "></div>
       </div>
    </div>

but since this looks like a bug - maybe a permanent fix is in order.

@drantunes
Copy link

I have a same problem.

@drantunes
Copy link

For now, I use ng-if in each div in same directory. Thus, the app-view-segment="1" works.

Comment: the http.get for the segment is loaded (firebug).

@vdsabev
Copy link

vdsabev commented Jan 7, 2015

We have the same issue, and since we can't have the ng-if in each segment template due to css specifics, we're using the workaround that @IKoshelev mentioned:

<div ng-if="ready" ng-include="::'segment.html'"></div>

And in the included template segment.html:

<div app-view-segment="1"></div>

@jeserkin
Copy link

Why doesn't it work around ="0"? Is there any fundamental reason, why shouldn't work?

@artch artch closed this as completed in 904b724 Mar 13, 2015
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

4 participants