angular-deckgrid icon indicating copy to clipboard operation
angular-deckgrid copied to clipboard

ng-if doesn't work inside child element template

Open voronianski opened this issue 12 years ago • 21 comments

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

I see this issue closed - https://github.com/akoenig/angular-deckgrid/issues/37 but the bug is present.

voronianski avatar Apr 08 '14 14:04 voronianski

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

voronianski avatar Apr 08 '14 15:04 voronianski

can you show some code?

tonyrh avatar Apr 08 '14 15:04 tonyrh

@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>

voronianski avatar Apr 08 '14 15:04 voronianski

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

tonyrh avatar Apr 08 '14 15:04 tonyrh

@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 avatar Apr 08 '14 15:04 voronianski

@tonyrh it's really easy reproduceable

voronianski avatar Apr 08 '14 19:04 voronianski

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,

tonyrh avatar Apr 08 '14 19:04 tonyrh

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

voronianski avatar Apr 08 '14 19:04 voronianski

@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 ...

akoenig avatar Apr 20 '14 18:04 akoenig

This bug seems to be fixed in Angular 1.3 - https://github.com/angular/angular.js/pull/7499

malixsys avatar Aug 19 '14 18:08 malixsys

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

akoenig avatar Oct 31 '14 20:10 akoenig

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.

danieljsinclair avatar Dec 02 '14 22:12 danieljsinclair

+1 Same here.

aomader avatar Dec 11 '14 13:12 aomader

:+1:

TimPetricola avatar Dec 31 '14 09:12 TimPetricola

I have the same issue with ng-switch

cansuB avatar Feb 02 '15 16:02 cansuB

I have same issue with ng-click

anandgargate avatar Sep 21 '15 08:09 anandgargate

+1 same issue with ng-if

lukichev avatar Dec 10 '15 20:12 lukichev

I have same issue with ng-click

nicolasmuller avatar Apr 21 '16 15:04 nicolasmuller

I have same issue with ng-click

maxhan247 avatar Jun 02 '16 05:06 maxhan247

Same issue with ng-if

murilozilli avatar Jun 20 '16 23:06 murilozilli

Same issue with ng-repeat

brunonunes avatar Sep 11 '16 17:09 brunonunes