Skip to content

Commit

Permalink
fix: null constants should work
Browse files Browse the repository at this point in the history
Fixes #111
  • Loading branch information
ocombe committed Feb 26, 2015
1 parent e25c4ef commit 83d416f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ocLazyLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,11 @@
} else if(angular.isObject(data)) { // constants & values for example
return JSON.stringify(data);
} else {
return data.toString();
if(angular.isDefined(data) && data !== null) {
return data.toString();
} else {
return data;
}
}
};
if(angular.isString(invokeList)) {
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/lazyLoad/testModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ testModule.directive("test", function () {
template: '<div>Test template {{1 + 1}}</div>'
};
});

testModule.constant("myConst1", "something");
testModule.constant("myConst2", undefined);
testModule.constant("myConst3", null);

0 comments on commit 83d416f

Please sign in to comment.