-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
74 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
angular | ||
.module("bawApp.services.core.bowser", []) | ||
.provider("bowser", function () { | ||
|
||
// TODO: is there a better way to load lodash without requiring it be attached to window? | ||
var bowser = window.bowser; | ||
|
||
this.$get = [function bowserFactory() { | ||
return bowser; | ||
}]; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//angular | ||
// .module("angularDefineHack") | ||
// .provider( | ||
// "angularDefineHack", | ||
// [ | ||
// "$window", | ||
// function ($window) { | ||
// | ||
// $window.define = function angularDefineHack(name, deps, callback) { | ||
// | ||
// if() | ||
// | ||
// | ||
// }; | ||
// | ||
// $window.define.amd = {}; | ||
// } | ||
// ]); | ||
|
||
angular.module("bawApp.services.core", [ | ||
"angularDefineHack", | ||
"bawApp.services.core.lodash", | ||
"bawApp.services.core.moment", | ||
|
||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
angular | ||
.module("bawApp.services.core.lodash", []) | ||
.provider("_", function () { | ||
|
||
// TODO: is there a better way to load lodash without requiring it be attached to window? | ||
var _ = window._; | ||
|
||
this.$get = [function lodashFactory() { | ||
return _; | ||
}]; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
angular | ||
.module("bawApp.services.core.moment", []) | ||
.provider("moment", function () { | ||
|
||
// TODO: is there a better way to load moment without requiring it be attached to window? | ||
var moment = window.moment; | ||
|
||
// HACK: add real duration formatting onto moment object! | ||
var humanizeDuration = window.humanizeDuration; | ||
this.$get = [function momentFactory() { | ||
moment.humanizeDuration = humanizeDuration; | ||
|
||
moment.duration.fn.humanizeDuration = function (parameters) { | ||
var ms = this.asMilliseconds(); | ||
if (parameters && parameters.round) { | ||
var rounding = Math.pow(10, Number(parameters.round)); | ||
if (angular.isNumber(rounding)) { | ||
ms = Math.round(ms / rounding) * rounding; | ||
} | ||
} | ||
|
||
return humanizeDuration(ms, parameters); | ||
}; | ||
|
||
return moment; | ||
}]; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.