akoenig / angular-deckgrid

A lightweight masonry-like grid for AngularJS.

Home Page:http://akoenig.github.io/angular-deckgrid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ng-if doesn't work inside child element template

voronianski opened this issue · comments

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

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

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

can you show some code?

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

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

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

@tonyrh it's really easy reproduceable

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 yeah.. but ng-show is not always good enough

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

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

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

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.

commented

+1 Same here.

I have the same issue with ng-switch

I have same issue with ng-click

+1 same issue with ng-if

I have same issue with ng-click

I have same issue with ng-click

Same issue with ng-if

Same issue with ng-repeat