Skip to content

Commit 9edac02

Browse files
author
Timothy E. Johansson
committed
Added dependencies
Added dependencies to avoid breaking the code when minifying.
1 parent dabfb3b commit 9edac02

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

angularjs.userapp.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var userappModule = angular.module('UserApp', []);
4646
};
4747

4848
// Authentication service
49-
userappModule.factory('user', function($rootScope, $location, $injector, $log, $timeout, $q) {
49+
userappModule.factory('user', ['$rootScope', '$location', '$injector', '$log', '$timeout', '$q', function($rootScope, $location, $injector, $log, $timeout, $q) {
5050
var user = {};
5151
var appId = null;
5252
var options = null;
@@ -636,10 +636,10 @@ var userappModule = angular.module('UserApp', []);
636636
});
637637

638638
return service;
639-
});
639+
}]);
640640

641641
// Logout directive
642-
userappModule.directive('uaLogout', function($timeout, user) {
642+
userappModule.directive('uaLogout', ['$timeout', 'user', function($timeout, user) {
643643
return {
644644
restrict: 'A',
645645
link: function(scope, element, attrs) {
@@ -666,10 +666,10 @@ var userappModule = angular.module('UserApp', []);
666666
element.on ? element.on('click', evHandler) : element.bind('click', evHandler);
667667
}
668668
};
669-
});
669+
}]);
670670

671671
// Login directive
672-
userappModule.directive('uaLogin', function($rootScope, $timeout, user) {
672+
userappModule.directive('uaLogin', ['$rootScope', '$timeout', 'user', function($rootScope, $timeout, user) {
673673
return {
674674
restrict: 'A',
675675
link: function(scope, element, attrs) {
@@ -705,10 +705,10 @@ var userappModule = angular.module('UserApp', []);
705705
element.on ? element.on('submit', evHandler) : element.bind('submit', evHandler);
706706
}
707707
};
708-
});
708+
}]);
709709

710710
// Signup directive
711-
userappModule.directive('uaSignup', function($rootScope, $timeout, user, UserApp) {
711+
userappModule.directive('uaSignup', ['$rootScope', '$timeout', 'user', 'UserApp', function($rootScope, $timeout, user, UserApp) {
712712
return {
713713
restrict: 'A',
714714
link: function(scope, element, attrs) {
@@ -769,10 +769,10 @@ var userappModule = angular.module('UserApp', []);
769769
element.on ? element.on('submit', evHandler) : element.bind('submit', evHandler);
770770
}
771771
};
772-
});
772+
}]);
773773

774774
// Reset password directive
775-
userappModule.directive('uaResetPassword', function($rootScope, $timeout, user) {
775+
userappModule.directive('uaResetPassword', ['$rootScope', '$timeout', 'user', function($rootScope, $timeout, user) {
776776
return {
777777
restrict: 'A',
778778
link: function(scope, element, attrs) {
@@ -809,10 +809,10 @@ var userappModule = angular.module('UserApp', []);
809809
element.on ? element.on('submit', evHandler) : element.bind('submit', evHandler);
810810
}
811811
};
812-
});
812+
}]);
813813

814814
// Set password directive
815-
userappModule.directive('uaSetPassword', function($rootScope, $location, $timeout, user) {
815+
userappModule.directive('uaSetPassword', ['$rootScope', '$location', '$timeout', 'user', function($rootScope, $location, $timeout, user) {
816816
return {
817817
restrict: 'A',
818818
link: function(scope, element, attrs) {
@@ -849,10 +849,10 @@ var userappModule = angular.module('UserApp', []);
849849
element.on ? element.on('submit', evHandler) : element.bind('submit', evHandler);
850850
}
851851
};
852-
});
852+
}]);
853853

854854
// OAuth URL directive
855-
userappModule.directive('uaOauthLink', function($timeout, $location, user, UserApp) {
855+
userappModule.directive('uaOauthLink', ['$timeout', '$location', 'user', 'UserApp', function($timeout, $location, user, UserApp) {
856856
return {
857857
restrict: 'A',
858858
link: function(scope, element, attrs) {
@@ -917,10 +917,10 @@ var userappModule = angular.module('UserApp', []);
917917
element.on ? element.on('click', evHandler) : element.bind('click', evHandler);
918918
}
919919
};
920-
});
920+
}]);
921921

922922
// hasPermission directive
923-
userappModule.directive('uaHasPermission', function(user) {
923+
userappModule.directive('uaHasPermission', ['user', function(user) {
924924
return {
925925
restrict: 'A',
926926
link: function(scope, element, attrs) {
@@ -941,10 +941,10 @@ var userappModule = angular.module('UserApp', []);
941941
}
942942
}
943943
};
944-
});
944+
}]);
945945

946946
// hasFeature directive
947-
userappModule.directive('uaHasFeature', function(user) {
947+
userappModule.directive('uaHasFeature', ['user', function(user) {
948948
return {
949949
restrict: 'A',
950950
link: function(scope, element, attrs) {
@@ -965,7 +965,7 @@ var userappModule = angular.module('UserApp', []);
965965
}
966966
}
967967
};
968-
});
968+
}]);
969969

970970
/*! Cookies.js - 0.3.1; Copyright (c) 2013, Scott Hamper; http://www.opensource.org/licenses/MIT */
971971
(function(e){"use strict";var a=function(b,d,c){return 1===arguments.length?a.get(b):a.set(b,d,c)};a._document=document;a._navigator=navigator;a.defaults={path:"/"};a.get=function(b){a._cachedDocumentCookie!==a._document.cookie&&a._renewCache();return a._cache[b]};a.set=function(b,d,c){c=a._getExtendedOptions(c);c.expires=a._getExpiresDate(d===e?-1:c.expires);a._document.cookie=a._generateCookieString(b,d,c);return a};a.expire=function(b,d){return a.set(b,e,d)};a._getExtendedOptions=function(b){return{path:b&& b.path||a.defaults.path,domain:b&&b.domain||a.defaults.domain,expires:b&&b.expires||a.defaults.expires,secure:b&&b.secure!==e?b.secure:a.defaults.secure}};a._isValidDate=function(b){return"[object Date]"===Object.prototype.toString.call(b)&&!isNaN(b.getTime())};a._getExpiresDate=function(b,d){d=d||new Date;switch(typeof b){case "number":b=new Date(d.getTime()+1E3*b);break;case "string":b=new Date(b)}if(b&&!a._isValidDate(b))throw Error("`expires` parameter cannot be converted to a valid Date instance"); return b};a._generateCookieString=function(b,a,c){b=encodeURIComponent(b);a=(a+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent);c=c||{};b=b+"="+a+(c.path?";path="+c.path:"");b+=c.domain?";domain="+c.domain:"";b+=c.expires?";expires="+c.expires.toUTCString():"";return b+=c.secure?";secure":""};a._getCookieObjectFromString=function(b){var d={};b=b?b.split("; "):[];for(var c=0;c<b.length;c++){var f=a._getKeyValuePairFromCookieString(b[c]);d[f.key]===e&&(d[f.key]=f.value)}return d};a._getKeyValuePairFromCookieString= function(b){var a=b.indexOf("="),a=0>a?b.length:a;return{key:decodeURIComponent(b.substr(0,a)),value:decodeURIComponent(b.substr(a+1))}};a._renewCache=function(){a._cache=a._getCookieObjectFromString(a._document.cookie);a._cachedDocumentCookie=a._document.cookie};a._areEnabled=function(){var b="1"===a.set("cookies.js",1).get("cookies.js");a.expire("cookies.js");return b};a.enabled=a._areEnabled();"function"===typeof define&&define.amd?define(function(){return a}):"undefined"!==typeof exports?("undefined"!== typeof module&&module.exports&&(exports=module.exports=a),exports.Cookies=a):window.Cookies=a})();

0 commit comments

Comments
 (0)