akoenig / angular-deckgrid

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

ng-model binding to custom directives taking too long #59

Open mboudreau opened 10 years ago

mboudreau commented 10 years ago

I have a custom directive that requires an ngModel, which I set myself within deckgrid card template like so:

<div deckgrid class="deckgrid" source="entries">
    <journal-entry ng-model="card" tag-search="mother.searchTags></journal-entry>
</div>

However, when the controller in my custom directive runs, the scope variable set as entry: '=ngModel' is undefined since it seems to not have been binded yet ($scope.entry is undefined). This use to work perfectly well until I integrated it with deckgrid. Since the template I use for my directive is all binded, it does show the appropriate data when the model becomes available within the scope, but it's a problem when I have to set certain defaults in my controller.

mboudreau commented 10 years ago

This has been fixed in my pull-request: https://github.com/akoenig/angular-deckgrid/pull/60