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

ng-if doesn't work inside child element template #44

Open
voronianski opened this issue Apr 8, 2014 · 21 comments
Open

ng-if doesn't work inside child element template #44

voronianski opened this issue Apr 8, 2014 · 21 comments

Comments

@voronianski
Copy link

ng-if inside card doesn't work.. module version is 0.4.1.

I see this issue closed - #37 but the bug is present.

@voronianski
Copy link
Author

update: it doesn't work inside template which is child to deckgrid element (inside external template file it works)

@voronianski voronianski changed the title ng-if doesn't work ng-if doesn't work inside child element template Apr 8, 2014
@tonyrh
Copy link

tonyrh commented Apr 8, 2014

can you show some code?

@voronianski
Copy link
Author

@tonyrh code is the same as in example at README, just use template as:

<div deckgrid source="photos" class="deckgrid">
    <div class="a-card">
        <h1>{{card.title}}</h1>

        <img src="" data-ng-src="{{card.src}}">
    </div>
</div>

@tonyrh
Copy link

tonyrh commented Apr 8, 2014

where is the ng-if that's not working in what you posted?

@voronianski
Copy link
Author

@tonyrh

<div deckgrid source="photos" class="deckgrid">
    <div class="a-card">
        <h1>{{card.title}}</h1>

        <img ng-if="card.src" ng-src="{{card.src}}">
    </div>
</div>

@voronianski
Copy link
Author

@tonyrh it's really easy reproduceable

@tonyrh
Copy link

tonyrh commented Apr 8, 2014

Yes indeed, it's easy to reproduce. I don't know how to fix it, as a workaround of sort you can use ng-show,

@voronianski
Copy link
Author

@tonyrh yeah.. but ng-show is not always good enough

@akoenig
Copy link
Owner

akoenig commented Apr 20, 2014

@voronianski I can confirm this issue. We have to find a solution for this scenario. It is a little bit tricky to grab the inner template because angular removes this DOM element before the Deckgrid has the chance to catch it ...

@malixsys
Copy link

This bug seems to be fixed in Angular 1.3 - angular/angular.js#7499

@akoenig
Copy link
Owner

akoenig commented Oct 31, 2014

@malixsys It is not a AngularJS issue (from my point of view). It is more like a timing problem (see my comment above).

@danieljsinclair
Copy link

I'm still getting this issue with 1.3.5 - ngIf doesn't include any nested content regardless of whether it resolves to truthy or falsey when used in a directive (isolate scope) when ngIf is in the directive's html template.

@aomader
Copy link

aomader commented Dec 11, 2014

+1 Same here.

@TimPetricola
Copy link

👍

@cansuB
Copy link

cansuB commented Feb 2, 2015

I have the same issue with ng-switch

@anandgargate
Copy link

I have same issue with ng-click

@lukichev
Copy link

+1 same issue with ng-if

@nicolasmuller
Copy link

I have same issue with ng-click

1 similar comment
@maxhan247
Copy link

I have same issue with ng-click

@murilozilli
Copy link

Same issue with ng-if

@brunonunes
Copy link

Same issue with ng-repeat

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