Skip to content

Commit

Permalink
fix: If there is no root, use angular from window
Browse files Browse the repository at this point in the history
  • Loading branch information
Menardi committed Apr 19, 2016
1 parent fc0f847 commit bcb8069
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/angular-localForage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/
(function(root, factory) {
'use strict';
var angular = root.angular || (window && window.angular);

var angular = root ? root.angular : window.angular;
if(typeof define === 'function' && define.amd) { // AMD
define(['localforage'], function(localforage) {
factory(angular, localforage);
Expand Down Expand Up @@ -484,3 +485,4 @@

return angularLocalForage.name;
});

2 changes: 1 addition & 1 deletion dist/angular-localForage.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/angular-localForage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function(root, factory) {
'use strict';

var angular = root.angular || (window && window.angular);
var angular = root ? root.angular : window.angular;
if(typeof define === 'function' && define.amd) { // AMD
define(['localforage'], function(localforage) {
factory(angular, localforage);
Expand Down

0 comments on commit bcb8069

Please sign in to comment.