akoenig / angular-deckgrid

A lightweight masonry-like grid for AngularJS.
http://akoenig.github.io/angular-deckgrid
MIT License
1.1k stars 191 forks source link

Nested transclude broken #111

Open jzahka opened 8 years ago

jzahka commented 8 years ago

When you include using the transclude method of inserting card template, and the contents include a directive that has a transclude, things get wonky.

Here is an example codepen.

[ngTransclude:orphan] Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found.

kbarresi commented 8 years ago

Can confirm when using with Angular Material's <md-button> directive.

jzahka commented 8 years ago

I've forked repo and made changes to use ng-transclude instead of ng-include which fixes the scope issues - at the cost of deprecating using cardTemplate and cardTemplateString.

And you'll have to use $parent.card instead of card when referencing the element in the transcluded item.

https://github.com/VegaFactor/angular-deckgrid