Skip to content

Commit 2d8d1c5

Browse files
committed
added constants
1 parent e83f611 commit 2d8d1c5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
3232
1. [Angular $ Wrapper Services](#angular-$-wrapper-services)
3333
1. [Comments](#comments)
3434
1. [JSHint](#js-hint)
35+
1. [Constants](#constants)
3536
1. [Angular Docs](#angular-docs)
3637
1. [Contributing](#contributing)
3738
1. [License](#license)
@@ -1086,6 +1087,29 @@ TODO
10861087
10871088
**[Back to top](#table-of-contents)**
10881089
1090+
## Constants
1091+
For anything else, API reference, check the [Angular documentation](//docs.angularjs.org/api).
1092+
1093+
- **Vendor Globals**: Create an AngularJS Constant for vendor libraries' global variables.
1094+
1095+
*Why?*: Provides a way to inject vendor libraries that otherwise are globals.
1096+
1097+
```javascript
1098+
// constants.js
1099+
1100+
/* global toastr:false, moment:false */
1101+
(function () {
1102+
'use strict';
1103+
1104+
angular
1105+
.module('app.core')
1106+
.constant('toastr', toastr)
1107+
.constant('moment', moment);
1108+
})();
1109+
```
1110+
1111+
**[Back to top](#table-of-contents)**
1112+
10891113
## AngularJS docs
10901114
For anything else, API reference, check the [Angular documentation](//docs.angularjs.org/api).
10911115

0 commit comments

Comments
 (0)