Skip to content

Commit

Permalink
Update UMD wrapper to include angular-cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
ruipenso committed Feb 5, 2016
1 parent c48dd80 commit f3f3df3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
22 changes: 18 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,24 @@ var config = {
umd: {
namespace: 'angularOAuth2',
exports: 'ngModule',
deps: [
'angular',
{ name: 'query-string', globalName: 'queryString', paramName: 'queryString' }
]
template: `
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([ "angular", "angular-cookies", "query-string" ], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require("angular"), require("angular-cookies"), require("query-string"));
} else {
root.<%= namespace %> = factory(root.angular, 'ngCookies', root.queryString);
}
}(this, function(angular, ngCookies, queryString) {
<% if (exports) { %>
<%= contents %>
return <%= exports %>;
<% } else { %>
return <%= contents %>;
<% } %>
}));
`
},
banner: ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
Expand Down
4 changes: 2 additions & 2 deletions src/angular-oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import OAuthProvider from './providers/oauth-provider';
import OAuthTokenProvider from './providers/oauth-token-provider';
import oauthConfig from './config/oauth-config';
import oauthInterceptor from './interceptors/oauth-interceptor';
import 'angular-cookies';
import ngCookies from 'angular-cookies';

var ngModule = angular.module('angular-oauth2', [
'ngCookies'
ngCookies
])
.config(oauthConfig)
.factory('oauthInterceptor', oauthInterceptor)
Expand Down

0 comments on commit f3f3df3

Please sign in to comment.