Skip to content

Commit fc16e16

Browse files
author
André König
committed
Implemented fallback for the case if the model is not available before first rendering (#31).
1 parent e16eb87 commit fc16e16

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

angular-deckgrid.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-deckgrid (v0.4.0) - Copyright: 2013 - 2014, André König ([email protected]) - MIT */
1+
/*! angular-deckgrid (v0.4.1) - Copyright: 2013 - 2014, André König ([email protected]) - MIT */
22
/*
33
* angular-deckgrid
44
*
@@ -368,6 +368,9 @@ angular.module('akoenig.deckgrid').factory('Deckgrid', [
368368
Deckgrid.prototype.$$onModelChange = function $$onModelChange (newModel, oldModel) {
369369
var self = this;
370370

371+
newModel = newModel || [];
372+
oldModel = oldModel || [];
373+
371374
if (oldModel.length !== newModel.length) {
372375
self.$$createColumns();
373376
}

angular-deckgrid.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-deckgrid",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"author": "André König ([email protected])",
55
"description": "A lightweight masonry-like grid for AngularJS.",
66
"license": "MIT",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-deckgrid",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"author": "André König ([email protected])",
55
"description": "A lightweight masonry-like grid for AngularJS.",
66
"license": "MIT",

src/deckgrid.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ angular.module('akoenig.deckgrid').factory('Deckgrid', [
229229
Deckgrid.prototype.$$onModelChange = function $$onModelChange (newModel, oldModel) {
230230
var self = this;
231231

232+
newModel = newModel || [];
233+
oldModel = oldModel || [];
234+
232235
if (oldModel.length !== newModel.length) {
233236
self.$$createColumns();
234237
}

0 commit comments

Comments
 (0)