├── application.js ├── bower.json ├── bower_components ├── angular │ ├── .bower.json │ ├── README.md │ ├── angular-csp.css │ ├── angular.js │ ├── angular.min.js │ ├── angular.min.js.gzip │ ├── angular.min.js.map │ ├── bower.json │ ├── index.js │ └── package.json ├── ocLazyLoad │ ├── .bower.json │ ├── CHANGELOG.md │ ├── LICENSE.md │ ├── README.md │ ├── bower.json │ └── dist │ │ ├── modules │ │ ├── ocLazyLoad.core.js │ │ ├── ocLazyLoad.directive.js │ │ ├── ocLazyLoad.loaders.common.js │ │ ├── ocLazyLoad.loaders.core.js │ │ ├── ocLazyLoad.loaders.cssLoader.js │ │ ├── ocLazyLoad.loaders.jsLoader.js │ │ ├── ocLazyLoad.loaders.requirejsLoader.js │ │ ├── ocLazyLoad.loaders.templatesLoader.js │ │ └── ocLazyLoad.polyfill.ie8.js │ │ ├── ocLazyLoad.js │ │ ├── ocLazyLoad.js.map │ │ ├── ocLazyLoad.min.js │ │ ├── ocLazyLoad.min.js.map │ │ ├── ocLazyLoad.require.js │ │ ├── ocLazyLoad.require.js.map │ │ ├── ocLazyLoad.require.min.js │ │ └── ocLazyLoad.require.min.js.map ├── requirejs │ ├── .bower.json │ ├── README.md │ ├── bower.json │ └── require.js └── ui-router │ ├── .bower.json │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── api │ └── angular-ui-router.d.ts │ ├── bower.json │ ├── release │ ├── angular-ui-router.js │ └── angular-ui-router.min.js │ └── src │ ├── common.js │ ├── resolve.js │ ├── state.js │ ├── stateDirectives.js │ ├── stateFilters.js │ ├── templateFactory.js │ ├── urlMatcherFactory.js │ ├── urlRouter.js │ ├── view.js │ ├── viewDirective.js │ └── viewScroll.js ├── home.html ├── index.html ├── main.js ├── module1 ├── controller1.js ├── module.js ├── module1.html └── service1.js └── module2 ├── directive2.js ├── module.js └── module2.html /application.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | 3 | var app = angular.module('mainModule', ['ui.router','oc.lazyLoad']); 4 | 5 | app.config(['$ocLazyLoadProvider','$stateProvider', '$urlRouterProvider', 6 | function ($ocLazyLoadProvider,$stateProvider, $urlRouterProvider) { 7 | 8 | $ocLazyLoadProvider.config({ 9 | loadedModules: ['mainModule'], 10 | asyncLoader: require 11 | }); 12 | 13 | $urlRouterProvider.otherwise('/home'); 14 | 15 | $stateProvider 16 | 17 | .state('home', { 18 | url: '/home', 19 | templateUrl: 'home.html' 20 | }) 21 | 22 | .state('module1', { 23 | url: '/module1', 24 | templateUrl: 'module1/module1.html', 25 | resolve: { 26 | load: function($ocLazyLoad) { 27 | 28 | return $ocLazyLoad.load ({ 29 | name: 'module1', 30 | files: ['module1/module.js'] 31 | 32 | }); 33 | } 34 | } 35 | }) 36 | 37 | .state('module2', { 38 | url: '/module2', 39 | templateUrl: 'module2/module2.html', 40 | resolve: { 41 | load: function($ocLazyLoad) { 42 | 43 | return $ocLazyLoad.load ({ 44 | name: 'module2', 45 | files: ['module2/module.js'] 46 | }); 47 | } 48 | } 49 | }); 50 | 51 | }]); 52 | 53 | app.bootstrap = function () { 54 | angular.bootstrap(document, ['mainModule']); 55 | }; 56 | 57 | return app; 58 | }); -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lazy-loaded-angular-app", 3 | "version": "0.0.0", 4 | "authors": [ 5 | "Torgeir Helgevold " 6 | ], 7 | 8 | "dependencies": { 9 | "angular": "~1.4.0", 10 | "ui-router": "~0.2.15", 11 | "ocLazyLoad": "~1.0.1", 12 | "requirejs": "~2.1.18" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /bower_components/angular/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.4.0", 4 | "main": "./angular.js", 5 | "ignore": [], 6 | "dependencies": {}, 7 | "homepage": "https://github.com/angular/bower-angular", 8 | "_release": "1.4.0", 9 | "_resolution": { 10 | "type": "version", 11 | "tag": "v1.4.0", 12 | "commit": "e2f2cf7dc4a3ef1859ab28e657eca0e9edb588ba" 13 | }, 14 | "_source": "git://github.com/angular/bower-angular.git", 15 | "_target": "~1.4.0", 16 | "_originalSource": "angular" 17 | } -------------------------------------------------------------------------------- /bower_components/angular/README.md: -------------------------------------------------------------------------------- 1 | # packaged angular 2 | 3 | This repo is for distribution on `npm` and `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | You can install this package either with `npm` or with `bower`. 10 | 11 | ### npm 12 | 13 | ```shell 14 | npm install angular 15 | ``` 16 | 17 | Then add a ` 21 | ``` 22 | 23 | Or `require('angular')` from your code. 24 | 25 | ### bower 26 | 27 | ```shell 28 | bower install angular 29 | ``` 30 | 31 | Then add a ` 35 | ``` 36 | 37 | ## Documentation 38 | 39 | Documentation is available on the 40 | [AngularJS docs site](http://docs.angularjs.org/). 41 | 42 | ## License 43 | 44 | The MIT License 45 | 46 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | -------------------------------------------------------------------------------- /bower_components/angular/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide:not(.ng-hide-animate) { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | 15 | .ng-animate-shim { 16 | visibility:hidden; 17 | } 18 | 19 | .ng-anchor { 20 | position:absolute; 21 | } 22 | -------------------------------------------------------------------------------- /bower_components/angular/angular.min.js.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelgevold/angular-lazy-load/57bedc51a11162193aecf1618380fcd778a21901/bower_components/angular/angular.min.js.gzip -------------------------------------------------------------------------------- /bower_components/angular/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.4.0", 4 | "main": "./angular.js", 5 | "ignore": [], 6 | "dependencies": { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bower_components/angular/index.js: -------------------------------------------------------------------------------- 1 | require('./angular'); 2 | module.exports = angular; 3 | -------------------------------------------------------------------------------- /bower_components/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.4.0", 4 | "description": "HTML enhanced for web apps", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/angular/angular.js.git" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "framework", 16 | "browser", 17 | "client-side" 18 | ], 19 | "author": "Angular Core Team ", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/angular/angular.js/issues" 23 | }, 24 | "homepage": "http://angularjs.org" 25 | } 26 | -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oclazyload", 3 | "version": "1.0.1", 4 | "description": "Load modules on demand (lazy load) with angularJS", 5 | "main": "dist/ocLazyLoad.js", 6 | "homepage": "https://github.com/ocombe/ocLazyLoad", 7 | "authors": [ 8 | "Olivier Combe " 9 | ], 10 | "license": "MIT", 11 | "keywords": [ 12 | "lazy load", 13 | "lazy-load", 14 | "lazyload", 15 | "load on demand", 16 | "module", 17 | "angular", 18 | "angularJS" 19 | ], 20 | "ignore": [ 21 | "**/.*", 22 | "node_modules", 23 | "bower_components", 24 | "src", 25 | "gulpfile.js", 26 | "package.json", 27 | "changelog.js", 28 | "validate-commit-msg.js", 29 | "tests", 30 | "karma.conf.js", 31 | "examples" 32 | ], 33 | "devDependencies": { 34 | "angular-mocks": "~1.3.2" 35 | }, 36 | "dependencies": { 37 | "angular": ">=1.2.x <=1.4.x" 38 | }, 39 | "_release": "1.0.1", 40 | "_resolution": { 41 | "type": "version", 42 | "tag": "1.0.1", 43 | "commit": "50cf26c83cd85cf81ad192a954a81aa743dcbe1c" 44 | }, 45 | "_source": "git://github.com/ocombe/ocLazyLoad.git", 46 | "_target": "~1.0.1", 47 | "_originalSource": "ocLazyLoad" 48 | } -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | # 1.0.1 (2015-06-01) 3 | 4 | 5 | ## Bug Fixes 6 | 7 | - don't remove filecache for files that were successfully loaded 8 | ([e2ed37c0](https://github.com/ocombe/ocLazyLoad/commit/e2ed37c0eff32d34419af6851bfc355e7fb6f3ad)) 9 | 10 | 11 | 12 | # 1.0.0 (2015-05-29) 13 | 14 | 15 | ## Bug Fixes 16 | 17 | - use parent element instead of head to insert files in native loaded 18 | ([ad4276a3](https://github.com/ocombe/ocLazyLoad/commit/ad4276a39cddf8ebfd8f247690e98fc306c2d3bb), 19 | [#164](https://github.com/ocombe/ocLazyLoad/issues/164)) 20 | - don't compile text nodes in the directive 21 | ([8900e493](https://github.com/ocombe/ocLazyLoad/commit/8900e493b8245084f4871d129250ffc54e565639), 22 | [#168](https://github.com/ocombe/ocLazyLoad/issues/168)) 23 | - files cache should be cleaned upon resolution of the promise 24 | ([9a186c93](https://github.com/ocombe/ocLazyLoad/commit/9a186c93ccb72c63a45e40c6c1e86319d9d004fa), 25 | [#189](https://github.com/ocombe/ocLazyLoad/issues/189)) 26 | - reject promise when calling 'load' instead of 'inject' 27 | ([31595472](https://github.com/ocombe/ocLazyLoad/commit/315954729aaa609d43aa7eb7750e8804cff9bf70), 28 | [#147](https://github.com/ocombe/ocLazyLoad/issues/147)) 29 | - make inject work as a standalone function when no params are given 30 | ([499bd72d](https://github.com/ocombe/ocLazyLoad/commit/499bd72ddaf6addbf2c649a48776bd2b6ff35227), 31 | [#171](https://github.com/ocombe/ocLazyLoad/issues/171)) 32 | - guard against null-refs when parsing Safari user-agents 33 | ([818aa5d0](https://github.com/ocombe/ocLazyLoad/commit/818aa5d0ddaa3909109d42b38f8921e9d4b18cda), 34 | [#188](https://github.com/ocombe/ocLazyLoad/issues/188)) 35 | - checking if we're not registering a component with a reserved name (such at `toString`) 36 | ([7362ca49](https://github.com/ocombe/ocLazyLoad/commit/7362ca493384c5b14e203b9c013085cbcab980f8 ), 37 | [#184](https://github.com/ocombe/ocLazyLoad/issues/184)) 38 | 39 | 40 | 41 | # 1.0.0-beta.2 (2015-04-20) 42 | 43 | 44 | ## Bug Fixes 45 | 46 | - Die infinite loops! You are not fun anymore (with param serie:true) 47 | ([dab34c0a](https://github.com/ocombe/ocLazyLoad/commit/dab34c0a3513061665850f68d983c1f2729f5f5a), 48 | [#166](https://github.com/ocombe/ocLazyLoad/issues/166)) 49 | 50 | 51 | 52 | # 1.0.0-beta.1 (2015-04-16) 53 | 54 | 55 | ## Bug Fixes 56 | 57 | - use document.querySelector for insertBefore when jQuery isn't available 58 | ([6e8fa8c3](https://github.com/ocombe/ocLazyLoad/commit/6e8fa8c37f4305c50241288db7fddc5ecae0ab8f), 59 | [#164](https://github.com/ocombe/ocLazyLoad/issues/164)) 60 | 61 | 62 | ## Documentation 63 | 64 | - adding a plunkr for issues 65 | ([2f408d27](https://github.com/ocombe/ocLazyLoad/commit/2f408d2729eaf3df9cc8434375611a5b26181c0b)) 66 | 67 | 68 | 69 | # 1.0.0-alpha.3 (2015-04-09) 70 | 71 | 72 | ## Bug Fixes 73 | 74 | - components can be registered as object maps now 75 | ([08ed860e](https://github.com/ocombe/ocLazyLoad/commit/08ed860e7051f1f0dd132d760b958c5be1114177), 76 | [#156](https://github.com/ocombe/ocLazyLoad/issues/156)) 77 | - make a real copy of the params 78 | ([6a5d3d4c](https://github.com/ocombe/ocLazyLoad/commit/6a5d3d4ca3fca1e90468aed10ef96f06669cd7f9), 79 | [#160](https://github.com/ocombe/ocLazyLoad/issues/160)) 80 | 81 | 82 | ## Features 83 | 84 | - ES6fy all the things! 85 | ([9cae48c8](https://github.com/ocombe/ocLazyLoad/commit/9cae48c828665e58132950d6db138d082f6bf2a2)) 86 | 87 | 88 | 89 | # 1.0.0-alpha2 (2015-03-23) 90 | 91 | 92 | ## Bug Fixes 93 | 94 | - hash shouldn't prevent file type detection 95 | ([9e1d0894](https://github.com/ocombe/ocLazyLoad/commit/9e1d089413e09b14b7b46d5ff5de4612613be5e9), 96 | [#153](https://github.com/ocombe/ocLazyLoad/issues/153)) 97 | 98 | 99 | 100 | # 1.0.0-alpha1 (2015-03-19) 101 | 102 | 103 | ## Features 104 | 105 | - ocLazyLoad is now modular and (partially) written in ES6! It should be easier to write new loaders (or even extensions), and you can cherry picks the parts that you like. For example, you can use the injector without the loaders. Also, all of the internal functions are available (preceded by an underscore, and undocumented), use them at your own risk (in fact you shouldn't need them unless you're writing an extension). 106 | 107 | 108 | ## Bug Fixes 109 | 110 | - the directive should append the content and not add it after 111 | - only the modules added via angular.bootstrap should be considered "already loaded" 112 | [#147](https://github.com/ocombe/ocLazyLoad/issues/147) 113 | 114 | ## TODO before the release 115 | - try to remove most of the promises for perfs/tests 116 | - use moaaar ES6 117 | - clean up the code 118 | 119 | 120 | 121 | # 0.6.3 (2015-03-09) 122 | 123 | 124 | ## Bug Fixes 125 | 126 | - detect file type when path contains url parameters 127 | ([57e1801d](https://github.com/ocombe/ocLazyLoad/commit/57e1801d933f978060954bd8707f586b51544906), 128 | [#137](https://github.com/ocombe/ocLazyLoad/issues/137)) 129 | - rejected promise should be returned immediately 130 | ([887a67c4](https://github.com/ocombe/ocLazyLoad/commit/887a67c4196fa4bbd65c34f6eba1d8b2bca9fed3)) 131 | 132 | 133 | 134 | # 0.6.2 (2015-03-05) 135 | 136 | 137 | ## Features 138 | 139 | - first step on supporting systemjs & import 140 | ([cb8dd62e](https://github.com/ocombe/ocLazyLoad/commit/cb8dd62ed9052995cbaf132d94092d1d103dd74d)) 141 | 142 | 143 | 144 | # 0.6.1 (2015-03-05) 145 | 146 | 147 | ## Bug Fixes 148 | 149 | - karma hack isn't needed anymore 150 | ([3108296e](https://github.com/ocombe/ocLazyLoad/commit/3108296e9d78da822e58333f2f7d674531ae937b)) 151 | - angular.bootstrap now adds modules to init, not replace them 152 | ([bdc03dd9](https://github.com/ocombe/ocLazyLoad/commit/bdc03dd9128eca7fca2421317b9f7b103c9b419c)) 153 | - fixed TypeError: Converting circular structure to JSON 154 | ([11da36d9](https://github.com/ocombe/ocLazyLoad/commit/11da36d90bc5bae588fa3770430d371d5f935aae)) 155 | - don't watch for angular.module calls when you're not lazy loading 156 | ([35f7eb5b](https://github.com/ocombe/ocLazyLoad/commit/35f7eb5be57f7753a20d7460c5a380f44e3ac175)) 157 | 158 | 159 | ## Performance Improvements 160 | 161 | - hash the signature to optimize memory consumption 162 | ([1cd9676e](https://github.com/ocombe/ocLazyLoad/commit/1cd9676e8799cff03458f7d2d4d144f624da9cfa)) 163 | 164 | 165 | 166 | # 0.6.0 (2015-02-27) 167 | 168 | 169 | ## Bug Fixes 170 | 171 | - staged lines missing from last commit 172 | ([dd24bcdd](https://github.com/ocombe/ocLazyLoad/commit/dd24bcdd573821ce7def60c173a15cbee2540de7)) 173 | - don't throw for karma 174 | ([633bec8b](https://github.com/ocombe/ocLazyLoad/commit/633bec8b38635e7d78aaa0e4ea8f1a8cdb85050e), 175 | [#129](https://github.com/ocombe/ocLazyLoad/issues/129)) 176 | - RequireJS should be able to load js files with no extension (default behavior) 177 | ([4f60d05d](https://github.com/ocombe/ocLazyLoad/commit/4f60d05d02039b700908545b60b71c3e2ca9bbf6)) 178 | - null constants should work 179 | ([83d416f9](https://github.com/ocombe/ocLazyLoad/commit/83d416f97d357d148efe97bafbaf2836ed7b3a3d), 180 | [#111](https://github.com/ocombe/ocLazyLoad/issues/111)) 181 | - keep track of components signatures instead of just the names 182 | ([6bbaed97](https://github.com/ocombe/ocLazyLoad/commit/6bbaed971cf2d23bb35a6ba5f29c6e6162edc5b5), 183 | [#120](https://github.com/ocombe/ocLazyLoad/issues/120)) 184 | - improve bootstrap & added compatibility with karma 185 | ([ff6afcf5](https://github.com/ocombe/ocLazyLoad/commit/ff6afcf5d3ef00e8e931fd548051f3103225cea8), 186 | [#111](https://github.com/ocombe/ocLazyLoad/issues/111)) 187 | 188 | 189 | ## Features 190 | 191 | - you don't need to specify the name of the lazy loaded modules anymore!! 192 | ([6634cbee](https://github.com/ocombe/ocLazyLoad/commit/6634cbee6c5ce84363be84ae5529a61a633585b5)) 193 | - added support for specifying the type of a file. 194 | ([a3549eea](https://github.com/ocombe/ocLazyLoad/commit/a3549eea93c67cfc4881ebe9d44c73c220790461)) 195 | 196 | 197 | ## Documentation 198 | 199 | - adding a table of contents 200 | ([98aad141](https://github.com/ocombe/ocLazyLoad/commit/98aad14141e2eae1d04f9fc1fe09d85cd4b14713)) 201 | 202 | 203 | 204 | # 0.5.2 (2014-12-30) 205 | 206 | 207 | ## Bug Fixes 208 | 209 | - use init for bootstrapped apps & removed the need for loadedModules 210 | ([01936cd6](https://github.com/ocombe/ocLazyLoad/commit/01936cd6fe0e0f89a203408ee0bbb927f5b44d07), 211 | [#84](https://github.com/ocombe/ocLazyLoad/issues/84), [#102](https://github.com/ocombe/ocLazyLoad/issues/102), [#109](https://github.com/ocombe/ocLazyLoad/issues/109)) 212 | 213 | 214 | ## Documentation 215 | 216 | - added a link to a new lesson from egghead.io 217 | ([ef8d2871](https://github.com/ocombe/ocLazyLoad/commit/ef8d2871a445b29588f779a27cb3b702d0da6a13)) 218 | 219 | 220 | 221 | # 0.5.1 (2014-11-20) 222 | 223 | 224 | ## Bug Fixes 225 | 226 | - don't use async when you load files in serie 227 | ([9af93ed3](https://github.com/ocombe/ocLazyLoad/commit/9af93ed30cf05c6c64594d206dc9bf36a318f46e), 228 | [#95](https://github.com/ocombe/ocLazyLoad/issues/95)) 229 | - avoid errors thrown on empty template files 230 | ([768b9d75](https://github.com/ocombe/ocLazyLoad/commit/768b9d751a613a0a10cb476d5c3eac5fdf44f627)) 231 | - compatibility with jasmine 232 | ([d4985e1d](https://github.com/ocombe/ocLazyLoad/commit/d4985e1d7ce98315ca64a72730d8c10524929d58), 233 | [#94](https://github.com/ocombe/ocLazyLoad/issues/94)) 234 | 235 | 236 | 237 | # 0.5.0 (2014-11-11) 238 | 239 | 240 | ## Features 241 | 242 | - added a new param `insertBefore` 243 | ([c4f10385](https://github.com/ocombe/ocLazyLoad/commit/c4f10385cb6a9122c3a03d28b1bb6837710cc3f7), 244 | [#91](https://github.com/ocombe/ocLazyLoad/issues/91)) 245 | - started unit tests 246 | ([dcc4ff63](https://github.com/ocombe/ocLazyLoad/commit/dcc4ff639df23a1b934899b020a483e47e6ab290)) 247 | 248 | 249 | ## Documentation 250 | 251 | - updated loaders signatures 252 | ([ba022894](https://github.com/ocombe/ocLazyLoad/commit/ba022894841222989cf699f07fe21f04f7ad3307)) 253 | 254 | 255 | 256 | # 0.4.2 (2014-11-10) 257 | 258 | 259 | ## Bug Fixes 260 | 261 | - extend config to params for the register method 262 | ([31157941](https://github.com/ocombe/ocLazyLoad/commit/31157941ccabfa8f8c55edc00dc2b5758bf073b2), 263 | [#89](https://github.com/ocombe/ocLazyLoad/issues/89)) 264 | 265 | 266 | 267 | # 0.4.1 (2014-11-09) 268 | 269 | 270 | ## Bug Fixes 271 | 272 | - keep global params pristine when loading files 273 | ([6b2306b7](https://github.com/ocombe/ocLazyLoad/commit/6b2306b71543542c9b592766644c7bba1297bae4), 274 | [#89](https://github.com/ocombe/ocLazyLoad/issues/89)) 275 | - defining new run blocks will replace previous ones 276 | ([af2627b5](https://github.com/ocombe/ocLazyLoad/commit/af2627b5e627b2b4d83cdd043eff68b1c1430740), 277 | [#89](https://github.com/ocombe/ocLazyLoad/issues/89)) 278 | 279 | 280 | 281 | # 0.4.0 (2014-11-09) 282 | 283 | 284 | ## Features 285 | 286 | - new parameter `serie` to load files in serie 287 | ([4ae7a3f3](https://github.com/ocombe/ocLazyLoad/commit/4ae7a3f3de6ad4de74baa6cc771aee556bce812e), 288 | [#47](https://github.com/ocombe/ocLazyLoad/issues/47), [#86](https://github.com/ocombe/ocLazyLoad/issues/86)) 289 | - new parameter `rerun` to rerun the run blocks 290 | ([26a64a38](https://github.com/ocombe/ocLazyLoad/commit/26a64a38b0c21b6ca28cfa7e512b0b290fdca619), 291 | [#89](https://github.com/ocombe/ocLazyLoad/issues/89)) 292 | - new function: `isLoaded` to check if a module has been loaded 293 | ([364c9e9f](https://github.com/ocombe/ocLazyLoad/commit/364c9e9ffd8350e5ca46a708bd3846ea6de9421c), 294 | [#79](https://github.com/ocombe/ocLazyLoad/issues/79)) 295 | 296 | 297 | 298 | # 0.3.10 (2014-11-09) 299 | 300 | 301 | ## Bug Fixes 302 | 303 | - fix for error:[$compile:multidir] Multiple directives 304 | ([61fd4dd3](https://github.com/ocombe/ocLazyLoad/commit/61fd4dd3b8131245d33eb2314dcf37a9188a6728), 305 | [#84](https://github.com/ocombe/ocLazyLoad/issues/84), 306 | [#78](https://github.com/ocombe/ocLazyLoad/issues/78), 307 | [#73](https://github.com/ocombe/ocLazyLoad/issues/73), 308 | [#58](https://github.com/ocombe/ocLazyLoad/issues/58)) 309 | - css onload patch for some old browsers 310 | ([14ce3406](https://github.com/ocombe/ocLazyLoad/commit/14ce34066e0e865c8fa86f663d38e046f7a32abb)) 311 | - content inside the oc-lazy-load directive is now compiled on load 312 | ([9962e2ef](https://github.com/ocombe/ocLazyLoad/commit/9962e2ef163e9449e295dd3297f6019267a0e0e1), 313 | [#80](https://github.com/ocombe/ocLazyLoad/issues/80)) 314 | 315 | 316 | 317 | # 0.3.9 (2014-11-02) 318 | 319 | 320 | ## Bug Fixes 321 | 322 | - allow components with the same name from different types/modules 323 | ([f981c337](https://github.com/ocombe/ocLazyLoad/commit/f981c33749e4e61fa4dfd7c3c41df9beffcbf734), 324 | [#67](https://github.com/ocombe/ocLazyLoad/issues/67)) 325 | - initial modules not registered 326 | ([bcf50004](https://github.com/ocombe/ocLazyLoad/commit/bcf50004b8a1172aff4c769746fdcb9e5d5d9cba), 327 | [#58](https://github.com/ocombe/ocLazyLoad/issues/58), [#71](https://github.com/ocombe/ocLazyLoad/issues/71), [#73](https://github.com/ocombe/ocLazyLoad/issues/73), [#77](https://github.com/ocombe/ocLazyLoad/issues/77)) 328 | - add support for angular 1.3 in bower 329 | ([bda921b6](https://github.com/ocombe/ocLazyLoad/commit/bda921b68ce30645d992982325adc4eebfdcd361), 330 | [#76](https://github.com/ocombe/ocLazyLoad/issues/76)) 331 | 332 | 333 | ## Features 334 | 335 | - broadcast for componentLoaded event provides more info (module name and type) 336 | ([d41b9f53](https://github.com/ocombe/ocLazyLoad/commit/d41b9f53a46ff8c97b780d4c24f6f64e16017b89)) 337 | - example1 now uses ui-grid instead of ng-grid 338 | ([e7cf1e83](https://github.com/ocombe/ocLazyLoad/commit/e7cf1e83ff1453ee5adb8112052d393f9dc09e27)) 339 | 340 | 341 | ## Documentation 342 | 343 | - added link to a new article by @kbdaitch 344 | ([cc6b41db](https://github.com/ocombe/ocLazyLoad/commit/cc6b41db5e0dbcfe68754df325bf9f09e5709bf2)) 345 | - added a link to a new lesson from egghead.io 346 | ([e231f3cb](https://github.com/ocombe/ocLazyLoad/commit/e231f3cbfd6fb3338479a5f4d8a9ce00d374646e)) 347 | - added a link to a new lesson from egghead.io 348 | ([9b3c48e4](https://github.com/ocombe/ocLazyLoad/commit/9b3c48e49800dd3ed6a01dad7c1d958f8625eddb)) 349 | 350 | 351 | 352 | # 0.3.8 (2014-09-25) 353 | 354 | 355 | ## Bug Fixes 356 | 357 | - reject on load error 358 | ([d83f52b5](https://github.com/ocombe/ocLazyLoad/commit/d83f52b56a77a5cdb230260c497ee2db7283e077), 359 | [#66](https://github.com/ocombe/ocLazyLoad/issues/66)) 360 | 361 | 362 | 363 | # 0.3.7 (2014-09-10) 364 | 365 | 366 | ## Bug Fixes 367 | 368 | - don't reload a dependency that was just loaded 369 | ([6752bb94](https://github.com/ocombe/ocLazyLoad/commit/6752bb948093f196311572530d814231dc2dcd3a), 370 | [#64](https://github.com/ocombe/ocLazyLoad/issues/64)) 371 | 372 | 373 | ## Features 374 | 375 | - new event ocLazyLoad.moduleReloaded 376 | ([5010d144](https://github.com/ocombe/ocLazyLoad/commit/5010d144d1b250424be2bcfa98faf50c6782bf96)) 377 | 378 | 379 | 380 | # 0.3.6 (2014-09-02) 381 | 382 | 383 | ## Bug Fixes 384 | 385 | - concurrency lazy loads (thanks @BenBlazely) 386 | ([4899ea1a](https://github.com/ocombe/ocLazyLoad/commit/4899ea1a09bee145f70aec3dd964f885060422d8), 387 | [#44](https://github.com/ocombe/ocLazyLoad/issues/44)) 388 | 389 | 390 | ## Documentation 391 | 392 | - added a few links to other examples 393 | 394 | 395 | 396 | # 0.3.5 (2014-08-26) 397 | 398 | 399 | ## Bug Fixes 400 | 401 | - fixed cases where the config block would not be called 402 | ([1e29c9d4](https://github.com/ocombe/ocLazyLoad/commit/1e29c9d438d494cd053cd7533921e02e3fe5e5d0), 403 | [#5](https://github.com/ocombe/ocLazyLoad/issues/5)). 404 | The config block would not be called if: 405 | - defined multiple times (only the first 1 would be invoked) 406 | - defined with an auto injected module: ['...', function() {}] 407 | - defined after another component: angular.module().controler().config() 408 | 409 | 410 | 411 | # 0.3.4 (2014-08-26) 412 | 413 | 414 | ## Bug Fixes 415 | 416 | - make sure reconfig:true always run all invoke blocks 417 | ([361ae6b7](https://github.com/ocombe/ocLazyLoad/commit/361ae6b7d319cb5ada1ab022a6761d4a67a31b58), 418 | [#54](https://github.com/ocombe/ocLazyLoad/issues/54)) 419 | - the config/run blocks were not invoked without reconfig: true 420 | ([300882a0](https://github.com/ocombe/ocLazyLoad/commit/300882a016e4f9d538e322be9718f21740048296), 421 | [#5](https://github.com/ocombe/ocLazyLoad/issues/5)) 422 | - indexOf polyfill for IE8 423 | ([5f71c09c](https://github.com/ocombe/ocLazyLoad/commit/5f71c09cad4255932e84c760b07d16a4a2b016d9), 424 | [#52](https://github.com/ocombe/ocLazyLoad/issues/52)) 425 | 426 | 427 | ## Features 428 | 429 | - more log messages for debug 430 | ([bcbca814](https://github.com/ocombe/ocLazyLoad/commit/bcbca814049863b4dd7a6c5c1071efd760094966)) 431 | 432 | 433 | 434 | # 0.3.3 (2014-07-23) 435 | 436 | 437 | ## Bug Fixes 438 | 439 | - don't execute config blocks multiple times by default 440 | ([e2fec59e](https://github.com/ocombe/ocLazyLoad/commit/e2fec59ee7ff1e95e7e78ef8397c4fe500d8e7c0), 441 | [#43](https://github.com/ocombe/ocLazyLoad/issues/43), [#41](https://github.com/ocombe/ocLazyLoad/issues/41)) 442 | - don't test for .js in path because of requirejs 443 | ([6045214b](https://github.com/ocombe/ocLazyLoad/commit/6045214b6a4cc2d9dee1c1f2f89946687d963828)) 444 | - test order 445 | ([8412cb43](https://github.com/ocombe/ocLazyLoad/commit/8412cb431bfc742f2c4151e5b089f3313a70035e)) 446 | 447 | 448 | 449 | # 0.3.2 (2014-07-23) 450 | 451 | 452 | ## Bug Fixes 453 | 454 | - allow $ocLazyLoadProvider.config to be called multiple times 455 | ([c590579c](https://github.com/ocombe/ocLazyLoad/commit/c590579c9512e0dd3fae2c33c0aefc0bb0f7ca7e), 456 | [#43](https://github.com/ocombe/ocLazyLoad/issues/43)) 457 | - prevent duplicate loadings 458 | ([12bc6b2b](https://github.com/ocombe/ocLazyLoad/commit/12bc6b2b2d1561517d56c14c56c15c332d578344), 459 | [#35](https://github.com/ocombe/ocLazyLoad/issues/35), 460 | [#38](https://github.com/ocombe/ocLazyLoad/issues/38)) 461 | 462 | 463 | 464 | # 0.3.1 (2014-07-14) 465 | 466 | 467 | ## Bug Fixes 468 | 469 | - don't reject file load with custom file loaders such as requirejs 470 | ([91ed522f](https://github.com/ocombe/ocLazyLoad/commit/91ed522f724c3d384146053623bbd1e7c2c86751), 471 | [#33](https://github.com/ocombe/ocLazyLoad/issues/33)) 472 | 473 | 474 | ## Features 475 | 476 | - auto changelog from commits msg 477 | ([c089e085](https://github.com/ocombe/ocLazyLoad/commit/c089e085431d9f1a968e94c78f3c5ac5af71fa72)) 478 | - prevent duplicate loadings & add a cache busting param 479 | ([5a5d7f10](https://github.com/ocombe/ocLazyLoad/commit/5a5d7f108578fe31c5ca1f7c8dfc2d3bccfd1106), 480 | [#38](https://github.com/ocombe/ocLazyLoad/issues/38)) 481 | 482 | 483 | # 0.3.0 (17 June 2014) 484 | 485 | ## Features 486 | 487 | - $ocLazyLoad will now reject promises on errors 488 | - Use the parameter `debug` to show log messages in the console 489 | - JS / CSS / Template loaders are available by default in $ocLazyLoad but you can overwrite them with the config 490 | - Better doc (finally! \o/) 491 | - Example1 is now much better ! 492 | - Events broadcasted on module / component / file load (#21) 493 | 494 | 495 | # 0.2.0 (20 May 2014) 496 | * Added support for $animateProvider #19 497 | * Added support for CSS Loading (And perhaps other file types in the future) #19 498 | * Added loadAll function for use when a state requires resolve on more than one asset. #19 499 | * FIX: Angular JS 1.3.0-beta.8 changed the way config blocks are handled (now invoked last) #19 500 | * Adopted the MIT license as requested in #20 501 | * Added a gulpfile to build dist files (and, in the future, to do tests before the build). Run `npm install` to install the new dependencies and `npm build` to build the dist files. 502 | * **Breaking change** moved the src files to /src and the dist files to /dist. Installations via bower will only see the dist folder 503 | * Moved the examples to /examples 504 | 505 | # 0.1.3 (30 April 2014) 506 | * Fix for bug #18: merged files and incorrect module loading 507 | 508 | # 0.1.2 (14 April 2014) 509 | * Fix for bug #16: config blocks didn't work for module dependencies 510 | 511 | # 0.1.1 (08 April 2014) 512 | * Fix for bug #8: runBlocks can now load new modules (thanks to @rolandzwaga) 513 | * Added an example that makes use of requirejs and uses ngGrid as a lazy loaded module (thanks to @rolandzwaga) 514 | 515 | # 0.1.0 (04 April 2014) 516 | * Added a changelog ! 517 | * Added ```loadTemplateFile``` function. 518 | * Merge pull request #6 from BenBlazely/master (Extension of lazy loading to the angular.module DI block, refactored to use promises for tracking progress.) 519 | * Merge pull request #7 from rolandzwaga/master (Added some improvements for apps using angular.boostrap & for duplicated modules) 520 | * Fixed a bug with run blocks not working when they used unloaded modules. Not a complete fix though, more to come when bug #8 is fixed 521 | -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Olivier Combe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/README.md: -------------------------------------------------------------------------------- 1 | ocLazyLoad [![Build Status](https://travis-ci.org/ocombe/ocLazyLoad.svg)](https://travis-ci.org/ocombe/ocLazyLoad) 2 | ========== 3 | 4 | Lazy load modules & components in AngularJS 5 | 6 | ---- 7 |

8 | 9 | Find all the documentation (and more) on https://oclazyload.readme.io 10 |

11 | ocLazyLoad 12 | 13 |

14 | ---- 15 | 16 | ## Key features 17 | - Dependencies are automatically loaded 18 | - Debugger friendly (no eval code) 19 | - The ability to mix normal boot and load on demand 20 | - Load via the service or the directive 21 | - Use the embedded async loader or use your own (requireJS, ...) 22 | - Load js (angular or not) / css / templates files 23 | - Compatible with AngularJS 1.2.x/1.3.x/1.4.x 24 | -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oclazyload", 3 | "version": "1.0.1", 4 | "description": "Load modules on demand (lazy load) with angularJS", 5 | "main": "dist/ocLazyLoad.js", 6 | "homepage": "https://github.com/ocombe/ocLazyLoad", 7 | "authors": [ 8 | "Olivier Combe " 9 | ], 10 | "license": "MIT", 11 | "keywords": [ 12 | "lazy load", 13 | "lazy-load", 14 | "lazyload", 15 | "load on demand", 16 | "module", 17 | "angular", 18 | "angularJS" 19 | ], 20 | "ignore": [ 21 | "**/.*", 22 | "node_modules", 23 | "bower_components", 24 | "src", 25 | "gulpfile.js", 26 | "package.json", 27 | "changelog.js", 28 | "validate-commit-msg.js", 29 | "tests", 30 | "karma.conf.js", 31 | "examples" 32 | ], 33 | "devDependencies": { 34 | "angular-mocks": "~1.3.2" 35 | }, 36 | "dependencies": { 37 | "angular": ">=1.2.x <=1.4.x" 38 | } 39 | } -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.directive.js: -------------------------------------------------------------------------------- 1 | (function (angular) { 2 | "use strict"; 3 | 4 | angular.module("oc.lazyLoad").directive("ocLazyLoad", ["$ocLazyLoad", "$compile", "$animate", "$parse", function ($ocLazyLoad, $compile, $animate, $parse) { 5 | return { 6 | restrict: "A", 7 | terminal: true, 8 | priority: 1000, 9 | compile: function compile(element, attrs) { 10 | // we store the content and remove it before compilation 11 | var content = element[0].innerHTML; 12 | element.html(""); 13 | 14 | return function ($scope, $element, $attr) { 15 | var model = $parse($attr.ocLazyLoad); 16 | $scope.$watch(function () { 17 | return model($scope) || $attr.ocLazyLoad; // it can be a module name (string), an object, an array, or a scope reference to any of this 18 | }, function (moduleName) { 19 | if (angular.isDefined(moduleName)) { 20 | $ocLazyLoad.load(moduleName).then(function () { 21 | $animate.enter(content, $element); 22 | var contents = element.contents(); 23 | angular.forEach(contents, function (content) { 24 | if (content.nodeType !== 3) { 25 | // 3 is a text node 26 | $compile(content)($scope); 27 | } 28 | }); 29 | }); 30 | } 31 | }, true); 32 | }; 33 | } 34 | }; 35 | }]); 36 | })(angular); -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.loaders.common.js: -------------------------------------------------------------------------------- 1 | (function (angular) { 2 | "use strict"; 3 | 4 | angular.module("oc.lazyLoad").config(["$provide", function ($provide) { 5 | $provide.decorator("$ocLazyLoad", ["$delegate", "$q", "$window", "$interval", function ($delegate, $q, $window, $interval) { 6 | var uaCssChecked = false, 7 | useCssLoadPatch = false, 8 | anchor = $window.document.getElementsByTagName("head")[0] || $window.document.getElementsByTagName("body")[0]; 9 | 10 | /** 11 | * Load a js/css file 12 | * @param type 13 | * @param path 14 | * @param params 15 | * @returns promise 16 | */ 17 | $delegate.buildElement = function buildElement(type, path, params) { 18 | var deferred = $q.defer(), 19 | el, 20 | loaded, 21 | filesCache = $delegate._getFilesCache(), 22 | cacheBuster = function cacheBuster(url) { 23 | var dc = new Date().getTime(); 24 | if (url.indexOf("?") >= 0) { 25 | if (url.substring(0, url.length - 1) === "&") { 26 | return "" + url + "_dc=" + dc; 27 | } 28 | return "" + url + "&_dc=" + dc; 29 | } else { 30 | return "" + url + "?_dc=" + dc; 31 | } 32 | }; 33 | 34 | // Store the promise early so the file load can be detected by other parallel lazy loads 35 | // (ie: multiple routes on one page) a 'true' value isn't sufficient 36 | // as it causes false positive load results. 37 | if (angular.isUndefined(filesCache.get(path))) { 38 | filesCache.put(path, deferred.promise); 39 | } 40 | 41 | // Switch in case more content types are added later 42 | switch (type) { 43 | case "css": 44 | el = $window.document.createElement("link"); 45 | el.type = "text/css"; 46 | el.rel = "stylesheet"; 47 | el.href = params.cache === false ? cacheBuster(path) : path; 48 | break; 49 | case "js": 50 | el = $window.document.createElement("script"); 51 | el.src = params.cache === false ? cacheBuster(path) : path; 52 | break; 53 | default: 54 | filesCache.remove(path); 55 | deferred.reject(new Error("Requested type \"" + type + "\" is not known. Could not inject \"" + path + "\"")); 56 | break; 57 | } 58 | el.onload = el.onreadystatechange = function (e) { 59 | if (el.readyState && !/^c|loade/.test(el.readyState) || loaded) return; 60 | el.onload = el.onreadystatechange = null; 61 | loaded = 1; 62 | $delegate._broadcast("ocLazyLoad.fileLoaded", path); 63 | deferred.resolve(); 64 | }; 65 | el.onerror = function () { 66 | filesCache.remove(path); 67 | deferred.reject(new Error("Unable to load " + path)); 68 | }; 69 | el.async = params.serie ? 0 : 1; 70 | 71 | var insertBeforeElem = anchor.lastChild; 72 | if (params.insertBefore) { 73 | var element = angular.element(angular.isDefined(window.jQuery) ? params.insertBefore : document.querySelector(params.insertBefore)); 74 | if (element && element.length > 0) { 75 | insertBeforeElem = element[0]; 76 | } 77 | } 78 | insertBeforeElem.parentNode.insertBefore(el, insertBeforeElem); 79 | 80 | /* 81 | The event load or readystatechange doesn't fire in: 82 | - iOS < 6 (default mobile browser) 83 | - Android < 4.4 (default mobile browser) 84 | - Safari < 6 (desktop browser) 85 | */ 86 | if (type == "css") { 87 | if (!uaCssChecked) { 88 | var ua = $window.navigator.userAgent.toLowerCase(); 89 | 90 | // iOS < 6 91 | if (/iP(hone|od|ad)/.test($window.navigator.platform)) { 92 | var v = $window.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); 93 | var iOSVersion = parseFloat([parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)].join(".")); 94 | useCssLoadPatch = iOSVersion < 6; 95 | } else if (ua.indexOf("android") > -1) { 96 | // Android < 4.4 97 | var androidVersion = parseFloat(ua.slice(ua.indexOf("android") + 8)); 98 | useCssLoadPatch = androidVersion < 4.4; 99 | } else if (ua.indexOf("safari") > -1) { 100 | var versionMatch = ua.match(/version\/([\.\d]+)/i); 101 | useCssLoadPatch = versionMatch && versionMatch[1] && parseFloat(versionMatch[1]) < 6; 102 | } 103 | } 104 | 105 | if (useCssLoadPatch) { 106 | var tries = 1000; // * 20 = 20000 miliseconds 107 | var interval = $interval(function () { 108 | try { 109 | el.sheet.cssRules; 110 | $interval.cancel(interval); 111 | el.onload(); 112 | } catch (e) { 113 | if (--tries <= 0) { 114 | el.onerror(); 115 | } 116 | } 117 | }, 20); 118 | } 119 | } 120 | 121 | return deferred.promise; 122 | }; 123 | 124 | return $delegate; 125 | }]); 126 | }]); 127 | })(angular); -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.loaders.core.js: -------------------------------------------------------------------------------- 1 | (function (angular) { 2 | "use strict"; 3 | 4 | angular.module("oc.lazyLoad").config(["$provide", function ($provide) { 5 | $provide.decorator("$ocLazyLoad", ["$delegate", "$q", function ($delegate, $q) { 6 | /** 7 | * The function that loads new files 8 | * @param config 9 | * @param params 10 | * @returns {*} 11 | */ 12 | $delegate.filesLoader = function filesLoader(config) { 13 | var params = arguments[1] === undefined ? {} : arguments[1]; 14 | 15 | var cssFiles = [], 16 | templatesFiles = [], 17 | jsFiles = [], 18 | promises = [], 19 | cachePromise = null, 20 | filesCache = $delegate._getFilesCache(); 21 | 22 | $delegate.toggleWatch(true); // start watching angular.module calls 23 | 24 | angular.extend(params, config); 25 | 26 | var pushFile = function pushFile(path) { 27 | var file_type = null, 28 | m; 29 | if (angular.isObject(path)) { 30 | file_type = path.type; 31 | path = path.path; 32 | } 33 | cachePromise = filesCache.get(path); 34 | if (angular.isUndefined(cachePromise) || params.cache === false) { 35 | 36 | // always check for requirejs syntax just in case 37 | if ((m = /^(css|less|html|htm|js)?(?=!)/.exec(path)) !== null) { 38 | // Detect file type using preceding type declaration (ala requireJS) 39 | file_type = m[1]; 40 | path = path.substr(m[1].length + 1, path.length); // Strip the type from the path 41 | } 42 | 43 | if (!file_type) { 44 | if ((m = /[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(path)) !== null) { 45 | // Detect file type via file extension 46 | file_type = m[1]; 47 | } else if (!$delegate.jsLoader.hasOwnProperty("ocLazyLoadLoader") && $delegate.jsLoader.hasOwnProperty("load")) { 48 | // requirejs 49 | file_type = "js"; 50 | } else { 51 | $delegate._$log.error("File type could not be determined. " + path); 52 | return; 53 | } 54 | } 55 | 56 | if ((file_type === "css" || file_type === "less") && cssFiles.indexOf(path) === -1) { 57 | cssFiles.push(path); 58 | } else if ((file_type === "html" || file_type === "htm") && templatesFiles.indexOf(path) === -1) { 59 | templatesFiles.push(path); 60 | } else if (file_type === "js" || jsFiles.indexOf(path) === -1) { 61 | jsFiles.push(path); 62 | } else { 63 | $delegate._$log.error("File type is not valid. " + path); 64 | } 65 | } else if (cachePromise) { 66 | promises.push(cachePromise); 67 | } 68 | }; 69 | 70 | if (params.serie) { 71 | pushFile(params.files.shift()); 72 | } else { 73 | angular.forEach(params.files, function (path) { 74 | pushFile(path); 75 | }); 76 | } 77 | 78 | if (cssFiles.length > 0) { 79 | var cssDeferred = $q.defer(); 80 | $delegate.cssLoader(cssFiles, function (err) { 81 | if (angular.isDefined(err) && $delegate.cssLoader.hasOwnProperty("ocLazyLoadLoader")) { 82 | $delegate._$log.error(err); 83 | cssDeferred.reject(err); 84 | } else { 85 | cssDeferred.resolve(); 86 | } 87 | }, params); 88 | promises.push(cssDeferred.promise); 89 | } 90 | 91 | if (templatesFiles.length > 0) { 92 | var templatesDeferred = $q.defer(); 93 | $delegate.templatesLoader(templatesFiles, function (err) { 94 | if (angular.isDefined(err) && $delegate.templatesLoader.hasOwnProperty("ocLazyLoadLoader")) { 95 | $delegate._$log.error(err); 96 | templatesDeferred.reject(err); 97 | } else { 98 | templatesDeferred.resolve(); 99 | } 100 | }, params); 101 | promises.push(templatesDeferred.promise); 102 | } 103 | 104 | if (jsFiles.length > 0) { 105 | var jsDeferred = $q.defer(); 106 | $delegate.jsLoader(jsFiles, function (err) { 107 | if (angular.isDefined(err) && $delegate.jsLoader.hasOwnProperty("ocLazyLoadLoader")) { 108 | $delegate._$log.error(err); 109 | jsDeferred.reject(err); 110 | } else { 111 | jsDeferred.resolve(); 112 | } 113 | }, params); 114 | promises.push(jsDeferred.promise); 115 | } 116 | 117 | if (promises.length === 0) { 118 | var deferred = $q.defer(), 119 | err = "Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'."; 120 | $delegate._$log.error(err); 121 | deferred.reject(err); 122 | return deferred.promise; 123 | } else if (params.serie && params.files.length > 0) { 124 | return $q.all(promises).then(function () { 125 | return $delegate.filesLoader(config, params); 126 | }); 127 | } else { 128 | return $q.all(promises)["finally"](function (res) { 129 | $delegate.toggleWatch(false); // stop watching angular.module calls 130 | return res; 131 | }); 132 | } 133 | }; 134 | 135 | /** 136 | * Load a module or a list of modules into Angular 137 | * @param module Mixed the name of a predefined module config object, or a module config object, or an array of either 138 | * @param params Object optional parameters 139 | * @returns promise 140 | */ 141 | $delegate.load = function (originalModule) { 142 | var originalParams = arguments[1] === undefined ? {} : arguments[1]; 143 | 144 | var self = this, 145 | config = null, 146 | deferredList = [], 147 | deferred = $q.defer(), 148 | errText; 149 | 150 | // clean copy 151 | var module = angular.copy(originalModule); 152 | var params = angular.copy(originalParams); 153 | 154 | // If module is an array, break it down 155 | if (angular.isArray(module)) { 156 | // Resubmit each entry as a single module 157 | angular.forEach(module, function (m) { 158 | deferredList.push(self.load(m, params)); 159 | }); 160 | 161 | // Resolve the promise once everything has loaded 162 | $q.all(deferredList).then(function (res) { 163 | deferred.resolve(res); 164 | }, function (err) { 165 | deferred.reject(err); 166 | }); 167 | 168 | return deferred.promise; 169 | } 170 | 171 | // Get or Set a configuration depending on what was passed in 172 | if (angular.isString(module)) { 173 | config = self.getModuleConfig(module); 174 | if (!config) { 175 | config = { 176 | files: [module] 177 | }; 178 | } 179 | } else if (angular.isObject(module)) { 180 | // case {type: 'js', path: lazyLoadUrl + 'testModule.fakejs'} 181 | if (angular.isDefined(module.path) && angular.isDefined(module.type)) { 182 | config = { 183 | files: [module] 184 | }; 185 | } else { 186 | config = self.setModuleConfig(module); 187 | } 188 | } 189 | 190 | if (config === null) { 191 | var moduleName = self._getModuleName(module); 192 | errText = "Module \"" + (moduleName || "unknown") + "\" is not configured, cannot load."; 193 | $delegate._$log.error(errText); 194 | deferred.reject(new Error(errText)); 195 | return deferred.promise; 196 | } else { 197 | // deprecated 198 | if (angular.isDefined(config.template)) { 199 | if (angular.isUndefined(config.files)) { 200 | config.files = []; 201 | } 202 | if (angular.isString(config.template)) { 203 | config.files.push(config.template); 204 | } else if (angular.isArray(config.template)) { 205 | config.files.concat(config.template); 206 | } 207 | } 208 | } 209 | 210 | var localParams = angular.extend({}, params, config); 211 | 212 | // if someone used an external loader and called the load function with just the module name 213 | if (angular.isUndefined(config.files) && angular.isDefined(config.name) && $delegate.moduleExists(config.name)) { 214 | return $delegate.inject(config.name, localParams); 215 | } 216 | 217 | $delegate.filesLoader(config, localParams).then(function () { 218 | $delegate.inject(null, localParams).then(function (res) { 219 | deferred.resolve(res); 220 | }, function (err) { 221 | deferred.reject(err); 222 | }); 223 | }, function (err) { 224 | deferred.reject(err); 225 | }); 226 | 227 | return deferred.promise; 228 | }; 229 | 230 | // return the patched service 231 | return $delegate; 232 | }]); 233 | }]); 234 | })(angular); -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.loaders.cssLoader.js: -------------------------------------------------------------------------------- 1 | (function (angular) { 2 | "use strict"; 3 | 4 | angular.module("oc.lazyLoad").config(["$provide", function ($provide) { 5 | $provide.decorator("$ocLazyLoad", ["$delegate", "$q", function ($delegate, $q) { 6 | /** 7 | * cssLoader function 8 | * @type Function 9 | * @param paths array list of css files to load 10 | * @param callback to call when everything is loaded. We use a callback and not a promise 11 | * @param params object config parameters 12 | * because the user can overwrite cssLoader and it will probably not use promises :( 13 | */ 14 | $delegate.cssLoader = function (paths, callback, params) { 15 | var promises = []; 16 | angular.forEach(paths, function (path) { 17 | promises.push($delegate.buildElement("css", path, params)); 18 | }); 19 | $q.all(promises).then(function () { 20 | callback(); 21 | }, function (err) { 22 | callback(err); 23 | }); 24 | }; 25 | $delegate.cssLoader.ocLazyLoadLoader = true; 26 | 27 | return $delegate; 28 | }]); 29 | }]); 30 | })(angular); -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.loaders.jsLoader.js: -------------------------------------------------------------------------------- 1 | (function (angular) { 2 | "use strict"; 3 | 4 | angular.module("oc.lazyLoad").config(["$provide", function ($provide) { 5 | $provide.decorator("$ocLazyLoad", ["$delegate", "$q", function ($delegate, $q) { 6 | /** 7 | * jsLoader function 8 | * @type Function 9 | * @param paths array list of js files to load 10 | * @param callback to call when everything is loaded. We use a callback and not a promise 11 | * @param params object config parameters 12 | * because the user can overwrite jsLoader and it will probably not use promises :( 13 | */ 14 | $delegate.jsLoader = function (paths, callback, params) { 15 | var promises = []; 16 | angular.forEach(paths, function (path) { 17 | promises.push($delegate.buildElement("js", path, params)); 18 | }); 19 | $q.all(promises).then(function () { 20 | callback(); 21 | }, function (err) { 22 | callback(err); 23 | }); 24 | }; 25 | $delegate.jsLoader.ocLazyLoadLoader = true; 26 | 27 | return $delegate; 28 | }]); 29 | }]); 30 | })(angular); -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.loaders.requirejsLoader.js: -------------------------------------------------------------------------------- 1 | (function (angular) { 2 | "use strict"; 3 | 4 | angular.module("oc.lazyLoad").config(["$provide", function ($provide) { 5 | $provide.decorator("$ocLazyLoad", ["$delegate", "$q", function ($delegate, $q) { 6 | /** 7 | * jsLoader function 8 | * @type Function 9 | * @param paths array list of js files to load 10 | * @param callback to call when everything is loaded. We use a callback and not a promise 11 | * @param params object config parameters 12 | * because the user can overwrite jsLoader and it will probably not use promises :( 13 | */ 14 | $delegate.jsLoader = require; 15 | 16 | return $delegate; 17 | }]); 18 | }]); 19 | })(angular); -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.loaders.templatesLoader.js: -------------------------------------------------------------------------------- 1 | (function (angular) { 2 | "use strict"; 3 | 4 | angular.module("oc.lazyLoad").config(["$provide", function ($provide) { 5 | $provide.decorator("$ocLazyLoad", ["$delegate", "$templateCache", "$q", "$http", function ($delegate, $templateCache, $q, $http) { 6 | /** 7 | * templatesLoader function 8 | * @type Function 9 | * @param paths array list of css files to load 10 | * @param callback to call when everything is loaded. We use a callback and not a promise 11 | * @param params object config parameters for $http 12 | * because the user can overwrite templatesLoader and it will probably not use promises :( 13 | */ 14 | $delegate.templatesLoader = function (paths, callback, params) { 15 | var promises = [], 16 | filesCache = $delegate._getFilesCache(); 17 | 18 | angular.forEach(paths, function (url) { 19 | var deferred = $q.defer(); 20 | promises.push(deferred.promise); 21 | $http.get(url, params).success(function (data) { 22 | if (angular.isString(data) && data.length > 0) { 23 | angular.forEach(angular.element(data), function (node) { 24 | if (node.nodeName === "SCRIPT" && node.type === "text/ng-template") { 25 | $templateCache.put(node.id, node.innerHTML); 26 | } 27 | }); 28 | } 29 | if (angular.isUndefined(filesCache.get(url))) { 30 | filesCache.put(url, true); 31 | } 32 | deferred.resolve(); 33 | }).error(function (err) { 34 | deferred.reject(new Error("Unable to load template file \"" + url + "\": " + err)); 35 | }); 36 | }); 37 | return $q.all(promises).then(function () { 38 | callback(); 39 | }, function (err) { 40 | callback(err); 41 | }); 42 | }; 43 | $delegate.templatesLoader.ocLazyLoadLoader = true; 44 | 45 | return $delegate; 46 | }]); 47 | }]); 48 | })(angular); -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/modules/ocLazyLoad.polyfill.ie8.js: -------------------------------------------------------------------------------- 1 | // Array.indexOf polyfill for IE8 2 | if (!Array.prototype.indexOf) { 3 | Array.prototype.indexOf = function (searchElement, fromIndex) { 4 | var k; 5 | 6 | // 1. Let O be the result of calling ToObject passing 7 | // the this value as the argument. 8 | if (this == null) { 9 | throw new TypeError("\"this\" is null or not defined"); 10 | } 11 | 12 | var O = Object(this); 13 | 14 | // 2. Let lenValue be the result of calling the Get 15 | // internal method of O with the argument "length". 16 | // 3. Let len be ToUint32(lenValue). 17 | var len = O.length >>> 0; 18 | 19 | // 4. If len is 0, return -1. 20 | if (len === 0) { 21 | return -1; 22 | } 23 | 24 | // 5. If argument fromIndex was passed let n be 25 | // ToInteger(fromIndex); else let n be 0. 26 | var n = +fromIndex || 0; 27 | 28 | if (Math.abs(n) === Infinity) { 29 | n = 0; 30 | } 31 | 32 | // 6. If n >= len, return -1. 33 | if (n >= len) { 34 | return -1; 35 | } 36 | 37 | // 7. If n >= 0, then Let k be n. 38 | // 8. Else, n<0, Let k be len - abs(n). 39 | // If k is less than 0, then let k be 0. 40 | k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); 41 | 42 | // 9. Repeat, while k < len 43 | while (k < len) { 44 | // a. Let Pk be ToString(k). 45 | // This is implicit for LHS operands of the in operator 46 | // b. Let kPresent be the result of calling the 47 | // HasProperty internal method of O with argument Pk. 48 | // This step can be combined with c 49 | // c. If kPresent is true, then 50 | // i. Let elementK be the result of calling the Get 51 | // internal method of O with the argument ToString(k). 52 | // ii. Let same be the result of applying the 53 | // Strict Equality Comparison Algorithm to 54 | // searchElement and elementK. 55 | // iii. If same is true, return k. 56 | if (k in O && O[k] === searchElement) { 57 | return k; 58 | } 59 | k++; 60 | } 61 | return -1; 62 | }; 63 | } -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/ocLazyLoad.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * oclazyload - Load modules on demand (lazy load) with angularJS 3 | * @version v1.0.1 4 | * @link https://github.com/ocombe/ocLazyLoad 5 | * @license MIT 6 | * @author Olivier Combe 7 | */ 8 | !function(e,n){"use strict";var r=["ng","oc.lazyLoad"],o={},t=[],i=[],a=[],s=e.noop,u={},c=[],l=e.module("oc.lazyLoad",["ng"]);l.provider("$ocLazyLoad",["$controllerProvider","$provide","$compileProvider","$filterProvider","$injector","$animateProvider",function(l,d,g,p,m,v){function y(n,o,t){if(o){var i,a,l,d=[];for(i=o.length-1;i>=0;i--)if(a=o[i],e.isString(a)||(a=j(a)),a&&-1===c.indexOf(a)){var f=-1===r.indexOf(a);if(l=h(a),f&&(r.push(a),y(n,l.requires,t)),l._runBlocks.length>0)for(u[a]=[];l._runBlocks.length>0;)u[a].push(l._runBlocks.shift());e.isDefined(u[a])&&(f||t.rerun)&&(d=d.concat(u[a])),$(n,l._invokeQueue,a,t.reconfig),$(n,l._configBlocks,a,t.reconfig),s(f?"ocLazyLoad.moduleLoaded":"ocLazyLoad.moduleReloaded",a),o.pop(),c.push(a)}var g=n.getInstanceInjector();e.forEach(d,function(e){g.invoke(e)})}}function L(n,r){function t(n){return e.isArray(n)?D(n.toString()):e.isObject(n)?D(z(n)):e.isDefined(n)&&null!==n?D(n.toString()):n}var i=n[2][0],a=n[1],u=!1;e.isUndefined(o[r])&&(o[r]={}),e.isUndefined(o[r][a])&&(o[r][a]={});var c=function(e,n){o[r][a].hasOwnProperty(e)||(o[r][a][e]=[]),-1===o[r][a][e].indexOf(n)&&(u=!0,o[r][a][e].push(n),s("ocLazyLoad.componentLoaded",[r,a,e]))};if(e.isString(i))c(i,t(n[2][1]));else{if(!e.isObject(i))return!1;e.forEach(i,function(n,r){e.isString(n)?c(n,t(i[1])):c(r,t(n))})}return u}function $(n,r,o,i){if(r){var a,s,u,c;for(a=0,s=r.length;s>a;a++)if(u=r[a],e.isArray(u)){if(null!==n){if(!n.hasOwnProperty(u[0]))throw new Error("unsupported provider "+u[0]);c=n[u[0]]}var l=L(u,o);if("invoke"!==u[1])l&&e.isDefined(c)&&c[u[1]].apply(c,u[2]);else{var d=function(n){var r=t.indexOf(""+o+"-"+n);(-1===r||i)&&(-1===r&&t.push(""+o+"-"+n),e.isDefined(c)&&c[u[1]].apply(c,u[2]))};if(e.isFunction(u[2][0]))d(u[2][0]);else if(e.isArray(u[2][0]))for(var f=0,h=u[2][0].length;h>f;f++)e.isFunction(u[2][0][f])&&d(u[2][0][f])}}}}function j(n){var r=null;return e.isString(n)?r=n:e.isObject(n)&&n.hasOwnProperty("name")&&e.isString(n.name)&&(r=n.name),r}function E(n){if(!e.isString(n))return!1;try{return h(n)}catch(r){if(/No module/.test(r)||r.message.indexOf("$injector:nomod")>-1)return!1}}var _={},w={$controllerProvider:l,$compileProvider:g,$filterProvider:p,$provide:d,$injector:m,$animateProvider:v},O=!1,b=!1,x=[];x.push=function(e){-1===this.indexOf(e)&&Array.prototype.push.apply(this,arguments)},this.config=function(n){e.isDefined(n.modules)&&(e.isArray(n.modules)?e.forEach(n.modules,function(e){_[e.name]=e}):_[n.modules.name]=n.modules),e.isDefined(n.debug)&&(O=n.debug),e.isDefined(n.events)&&(b=n.events)},this._init=function(o){if(0===i.length){var t=[o],s=["ng:app","ng-app","x-ng-app","data-ng-app"],u=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/,c=function(e){return e&&t.push(e)};e.forEach(s,function(n){s[n]=!0,c(document.getElementById(n)),n=n.replace(":","\\:"),o[0].querySelectorAll&&(e.forEach(o[0].querySelectorAll("."+n),c),e.forEach(o[0].querySelectorAll("."+n+"\\:"),c),e.forEach(o[0].querySelectorAll("["+n+"]"),c))}),e.forEach(t,function(n){if(0===i.length){var r=" "+o.className+" ",t=u.exec(r);t?i.push((t[2]||"").replace(/\s+/g,",")):e.forEach(n.attributes,function(e){0===i.length&&s[e.name]&&i.push(e.value)})}})}0!==i.length||(n.jasmine||n.mocha)&&e.isDefined(e.mock)||console.error("No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.");var l=function d(n){if(-1===r.indexOf(n)){r.push(n);var o=e.module(n);$(null,o._invokeQueue,n),$(null,o._configBlocks,n),e.forEach(o.requires,d)}};e.forEach(i,function(e){l(e)}),i=[],a.pop()};var z=function(n){var r=[];return JSON.stringify(n,function(n,o){if(e.isObject(o)&&null!==o){if(-1!==r.indexOf(o))return;r.push(o)}return o})},D=function(e){var n,r,o,t=0;if(0==e.length)return t;for(n=0,o=e.length;o>n;n++)r=e.charCodeAt(n),t=(t<<5)-t+r,t|=0;return t};this.$get=["$log","$rootElement","$rootScope","$cacheFactory","$q",function(n,o,t,u,l){function d(e){var r=l.defer();return n.error(e.message),r.reject(e),r.promise}var g,p=u("ocLazyLoad");return O||(n={},n.error=e.noop,n.warn=e.noop,n.info=e.noop),w.getInstanceInjector=function(){return g?g:g=o.data("$injector")||e.injector()},s=function(e,r){b&&t.$broadcast(e,r),O&&n.info(e,r)},{_broadcast:s,_$log:n,_getFilesCache:function(){return p},toggleWatch:function(e){e?a.push(!0):a.pop()},getModuleConfig:function(n){if(!e.isString(n))throw new Error("You need to give the name of the module to get");return _[n]?e.copy(_[n]):null},setModuleConfig:function(n){if(!e.isObject(n))throw new Error("You need to give the module config object to set");return _[n.name]=n,n},getModules:function(){return r},isLoaded:function(n){var o=function(e){var n=r.indexOf(e)>-1;return n||(n=!!E(e)),n};if(e.isString(n)&&(n=[n]),e.isArray(n)){var t,i;for(t=0,i=n.length;i>t;t++)if(!o(n[t]))return!1;return!0}throw new Error("You need to define the module(s) name(s)")},_getModuleName:j,_getModule:function(e){try{return h(e)}catch(n){throw(/No module/.test(n)||n.message.indexOf("$injector:nomod")>-1)&&(n.message='The module "'+z(e)+'" that you are trying to load does not exist. '+n.message),n}},moduleExists:E,_loadDependencies:function(n,r){var o,t,i,a=[],s=this;if(n=s._getModuleName(n),null===n)return l.when();try{o=s._getModule(n)}catch(u){return d(u)}return t=s.getRequires(o),e.forEach(t,function(o){if(e.isString(o)){var t=s.getModuleConfig(o);if(null===t)return void x.push(o);o=t}if(s.moduleExists(o.name))return i=o.files.filter(function(e){return s.getModuleConfig(o.name).files.indexOf(e)<0}),0!==i.length&&s._$log.warn('Module "',n,'" attempted to redefine configuration for dependency. "',o.name,'"\n Additional Files Loaded:',i),e.isDefined(s.filesLoader)?void a.push(s.filesLoader(o,r).then(function(){return s._loadDependencies(o)})):d(new Error("Error: New dependencies need to be loaded from external files ("+o.files+"), but no loader has been defined."));if(e.isArray(o)?o={files:o}:e.isObject(o)&&o.hasOwnProperty("name")&&o.name&&(s.setModuleConfig(o),x.push(o.name)),e.isDefined(o.files)&&0!==o.files.length){if(!e.isDefined(s.filesLoader))return d(new Error('Error: the module "'+o.name+'" is defined in external files ('+o.files+"), but no loader has been defined."));a.push(s.filesLoader(o,r).then(function(){return s._loadDependencies(o)}))}}),l.all(a)},inject:function(n){var r=void 0===arguments[1]?{}:arguments[1],o=this,t=l.defer();if(e.isDefined(n)&&null!==n){if(e.isArray(n)){var a=[];return e.forEach(n,function(e){a.push(o.inject(e))}),l.all(a)}o._addToLoadList(o._getModuleName(n),!0)}if(i.length>0){var s=i.slice(),u=function d(e){x.push(e),o._loadDependencies(e,r).then(function(){try{c=[],y(w,x,r)}catch(e){return o._$log.error(e.message),void t.reject(e)}i.length>0?d(i.shift()):t.resolve(s)},function(e){t.reject(e)})};u(i.shift())}else t.resolve();return t.promise},getRequires:function(n){var o=[];return e.forEach(n.requires,function(e){-1===r.indexOf(e)&&o.push(e)}),o},_invokeQueue:$,_registerInvokeList:L,_register:y,_addToLoadList:f}}],this._init(e.element(n.document))}]);var d=e.bootstrap;e.bootstrap=function(n,r,o){return e.forEach(r.slice(),function(e){f(e,!0)}),d(n,r,o)};var f=function(n,r){(a.length>0||r)&&e.isString(n)&&-1===i.indexOf(n)&&i.push(n)},h=e.module;e.module=function(e,n,r){return f(e),h(e,n,r)}}(angular,window),function(e){"use strict";e.module("oc.lazyLoad").directive("ocLazyLoad",["$ocLazyLoad","$compile","$animate","$parse",function(n,r,o,t){return{restrict:"A",terminal:!0,priority:1e3,compile:function(i){var a=i[0].innerHTML;return i.html(""),function(s,u,c){var l=t(c.ocLazyLoad);s.$watch(function(){return l(s)||c.ocLazyLoad},function(t){e.isDefined(t)&&n.load(t).then(function(){o.enter(a,u);var n=i.contents();e.forEach(n,function(e){3!==e.nodeType&&r(e)(s)})})},!0)}}}}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q","$window","$interval",function(n,r,o,t){var i=!1,a=!1,s=o.document.getElementsByTagName("head")[0]||o.document.getElementsByTagName("body")[0];return n.buildElement=function(u,c,l){var d,f,h=r.defer(),g=n._getFilesCache(),p=function(e){var n=(new Date).getTime();return e.indexOf("?")>=0?"&"===e.substring(0,e.length-1)?""+e+"_dc="+n:""+e+"&_dc="+n:""+e+"?_dc="+n};switch(e.isUndefined(g.get(c))&&g.put(c,h.promise),u){case"css":d=o.document.createElement("link"),d.type="text/css",d.rel="stylesheet",d.href=l.cache===!1?p(c):c;break;case"js":d=o.document.createElement("script"),d.src=l.cache===!1?p(c):c;break;default:g.remove(c),h.reject(new Error('Requested type "'+u+'" is not known. Could not inject "'+c+'"'))}d.onload=d.onreadystatechange=function(){d.readyState&&!/^c|loade/.test(d.readyState)||f||(d.onload=d.onreadystatechange=null,f=1,n._broadcast("ocLazyLoad.fileLoaded",c),h.resolve())},d.onerror=function(){g.remove(c),h.reject(new Error("Unable to load "+c))},d.async=l.serie?0:1;var m=s.lastChild;if(l.insertBefore){var v=e.element(e.isDefined(window.jQuery)?l.insertBefore:document.querySelector(l.insertBefore));v&&v.length>0&&(m=v[0])}if(m.parentNode.insertBefore(d,m),"css"==u){if(!i){var y=o.navigator.userAgent.toLowerCase();if(/iP(hone|od|ad)/.test(o.navigator.platform)){var L=o.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),$=parseFloat([parseInt(L[1],10),parseInt(L[2],10),parseInt(L[3]||0,10)].join("."));a=6>$}else if(y.indexOf("android")>-1){var j=parseFloat(y.slice(y.indexOf("android")+8));a=4.4>j}else if(y.indexOf("safari")>-1){var E=y.match(/version\/([\.\d]+)/i);a=E&&E[1]&&parseFloat(E[1])<6}}if(a)var _=1e3,w=t(function(){try{d.sheet.cssRules,t.cancel(w),d.onload()}catch(e){--_<=0&&d.onerror()}},20)}return h.promise},n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.filesLoader=function(o){var t=void 0===arguments[1]?{}:arguments[1],i=[],a=[],s=[],u=[],c=null,l=n._getFilesCache();n.toggleWatch(!0),e.extend(t,o);var d=function(r){var o,d=null;if(e.isObject(r)&&(d=r.type,r=r.path),c=l.get(r),e.isUndefined(c)||t.cache===!1){if(null!==(o=/^(css|less|html|htm|js)?(?=!)/.exec(r))&&(d=o[1],r=r.substr(o[1].length+1,r.length)),!d)if(null!==(o=/[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(r)))d=o[1];else{if(n.jsLoader.hasOwnProperty("ocLazyLoadLoader")||!n.jsLoader.hasOwnProperty("load"))return void n._$log.error("File type could not be determined. "+r);d="js"}"css"!==d&&"less"!==d||-1!==i.indexOf(r)?"html"!==d&&"htm"!==d||-1!==a.indexOf(r)?"js"===d||-1===s.indexOf(r)?s.push(r):n._$log.error("File type is not valid. "+r):a.push(r):i.push(r)}else c&&u.push(c)};if(t.serie?d(t.files.shift()):e.forEach(t.files,function(e){d(e)}),i.length>0){var f=r.defer();n.cssLoader(i,function(r){e.isDefined(r)&&n.cssLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),f.reject(r)):f.resolve()},t),u.push(f.promise)}if(a.length>0){var h=r.defer();n.templatesLoader(a,function(r){e.isDefined(r)&&n.templatesLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),h.reject(r)):h.resolve()},t),u.push(h.promise)}if(s.length>0){var g=r.defer();n.jsLoader(s,function(r){e.isDefined(r)&&n.jsLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),g.reject(r)):g.resolve()},t),u.push(g.promise)}if(0===u.length){var p=r.defer(),m="Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.";return n._$log.error(m),p.reject(m),p.promise}return t.serie&&t.files.length>0?r.all(u).then(function(){return n.filesLoader(o,t)}):r.all(u)["finally"](function(e){return n.toggleWatch(!1),e})},n.load=function(o){var t,i=void 0===arguments[1]?{}:arguments[1],a=this,s=null,u=[],c=r.defer(),l=e.copy(o),d=e.copy(i);if(e.isArray(l))return e.forEach(l,function(e){u.push(a.load(e,d))}),r.all(u).then(function(e){c.resolve(e)},function(e){c.reject(e)}),c.promise;if(e.isString(l)?(s=a.getModuleConfig(l),s||(s={files:[l]})):e.isObject(l)&&(s=e.isDefined(l.path)&&e.isDefined(l.type)?{files:[l]}:a.setModuleConfig(l)),null===s){var f=a._getModuleName(l);return t='Module "'+(f||"unknown")+'" is not configured, cannot load.',n._$log.error(t),c.reject(new Error(t)),c.promise}e.isDefined(s.template)&&(e.isUndefined(s.files)&&(s.files=[]),e.isString(s.template)?s.files.push(s.template):e.isArray(s.template)&&s.files.concat(s.template));var h=e.extend({},d,s);return e.isUndefined(s.files)&&e.isDefined(s.name)&&n.moduleExists(s.name)?n.inject(s.name,h):(n.filesLoader(s,h).then(function(){n.inject(null,h).then(function(e){c.resolve(e)},function(e){c.reject(e)})},function(e){c.reject(e)}),c.promise)},n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.cssLoader=function(o,t,i){var a=[];e.forEach(o,function(e){a.push(n.buildElement("css",e,i))}),r.all(a).then(function(){t()},function(e){t(e)})},n.cssLoader.ocLazyLoadLoader=!0,n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.jsLoader=function(o,t,i){var a=[];e.forEach(o,function(e){a.push(n.buildElement("js",e,i))}),r.all(a).then(function(){t()},function(e){t(e)})},n.jsLoader.ocLazyLoadLoader=!0,n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$templateCache","$q","$http",function(n,r,o,t){return n.templatesLoader=function(i,a,s){var u=[],c=n._getFilesCache();return e.forEach(i,function(n){var i=o.defer();u.push(i.promise),t.get(n,s).success(function(o){e.isString(o)&&o.length>0&&e.forEach(e.element(o),function(e){"SCRIPT"===e.nodeName&&"text/ng-template"===e.type&&r.put(e.id,e.innerHTML)}),e.isUndefined(c.get(n))&&c.put(n,!0),i.resolve()}).error(function(e){i.reject(new Error('Unable to load template file "'+n+'": '+e))})}),o.all(u).then(function(){a()},function(e){a(e)})},n.templatesLoader.ocLazyLoadLoader=!0,n}])}])}(angular),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,n){var r;if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),t=o.length>>>0;if(0===t)return-1;var i=+n||0;if(1/0===Math.abs(i)&&(i=0),i>=t)return-1;for(r=Math.max(i>=0?i:t-Math.abs(i),0);t>r;){if(r in o&&o[r]===e)return r;r++}return-1}); 9 | //# sourceMappingURL=ocLazyLoad.min.js.map -------------------------------------------------------------------------------- /bower_components/ocLazyLoad/dist/ocLazyLoad.require.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * oclazyload - Load modules on demand (lazy load) with angularJS 3 | * @version v1.0.1 4 | * @link https://github.com/ocombe/ocLazyLoad 5 | * @license MIT 6 | * @author Olivier Combe 7 | */ 8 | !function(e,n){"use strict";var r=["ng","oc.lazyLoad"],o={},t=[],i=[],a=[],s=e.noop,u={},c=[],l=e.module("oc.lazyLoad",["ng"]);l.provider("$ocLazyLoad",["$controllerProvider","$provide","$compileProvider","$filterProvider","$injector","$animateProvider",function(l,d,g,p,m,v){function y(n,o,t){if(o){var i,a,l,d=[];for(i=o.length-1;i>=0;i--)if(a=o[i],e.isString(a)||(a=j(a)),a&&-1===c.indexOf(a)){var f=-1===r.indexOf(a);if(l=h(a),f&&(r.push(a),y(n,l.requires,t)),l._runBlocks.length>0)for(u[a]=[];l._runBlocks.length>0;)u[a].push(l._runBlocks.shift());e.isDefined(u[a])&&(f||t.rerun)&&(d=d.concat(u[a])),$(n,l._invokeQueue,a,t.reconfig),$(n,l._configBlocks,a,t.reconfig),s(f?"ocLazyLoad.moduleLoaded":"ocLazyLoad.moduleReloaded",a),o.pop(),c.push(a)}var g=n.getInstanceInjector();e.forEach(d,function(e){g.invoke(e)})}}function L(n,r){function t(n){return e.isArray(n)?D(n.toString()):e.isObject(n)?D(z(n)):e.isDefined(n)&&null!==n?D(n.toString()):n}var i=n[2][0],a=n[1],u=!1;e.isUndefined(o[r])&&(o[r]={}),e.isUndefined(o[r][a])&&(o[r][a]={});var c=function(e,n){o[r][a].hasOwnProperty(e)||(o[r][a][e]=[]),-1===o[r][a][e].indexOf(n)&&(u=!0,o[r][a][e].push(n),s("ocLazyLoad.componentLoaded",[r,a,e]))};if(e.isString(i))c(i,t(n[2][1]));else{if(!e.isObject(i))return!1;e.forEach(i,function(n,r){e.isString(n)?c(n,t(i[1])):c(r,t(n))})}return u}function $(n,r,o,i){if(r){var a,s,u,c;for(a=0,s=r.length;s>a;a++)if(u=r[a],e.isArray(u)){if(null!==n){if(!n.hasOwnProperty(u[0]))throw new Error("unsupported provider "+u[0]);c=n[u[0]]}var l=L(u,o);if("invoke"!==u[1])l&&e.isDefined(c)&&c[u[1]].apply(c,u[2]);else{var d=function(n){var r=t.indexOf(""+o+"-"+n);(-1===r||i)&&(-1===r&&t.push(""+o+"-"+n),e.isDefined(c)&&c[u[1]].apply(c,u[2]))};if(e.isFunction(u[2][0]))d(u[2][0]);else if(e.isArray(u[2][0]))for(var f=0,h=u[2][0].length;h>f;f++)e.isFunction(u[2][0][f])&&d(u[2][0][f])}}}}function j(n){var r=null;return e.isString(n)?r=n:e.isObject(n)&&n.hasOwnProperty("name")&&e.isString(n.name)&&(r=n.name),r}function E(n){if(!e.isString(n))return!1;try{return h(n)}catch(r){if(/No module/.test(r)||r.message.indexOf("$injector:nomod")>-1)return!1}}var _={},w={$controllerProvider:l,$compileProvider:g,$filterProvider:p,$provide:d,$injector:m,$animateProvider:v},O=!1,b=!1,x=[];x.push=function(e){-1===this.indexOf(e)&&Array.prototype.push.apply(this,arguments)},this.config=function(n){e.isDefined(n.modules)&&(e.isArray(n.modules)?e.forEach(n.modules,function(e){_[e.name]=e}):_[n.modules.name]=n.modules),e.isDefined(n.debug)&&(O=n.debug),e.isDefined(n.events)&&(b=n.events)},this._init=function(o){if(0===i.length){var t=[o],s=["ng:app","ng-app","x-ng-app","data-ng-app"],u=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/,c=function(e){return e&&t.push(e)};e.forEach(s,function(n){s[n]=!0,c(document.getElementById(n)),n=n.replace(":","\\:"),o[0].querySelectorAll&&(e.forEach(o[0].querySelectorAll("."+n),c),e.forEach(o[0].querySelectorAll("."+n+"\\:"),c),e.forEach(o[0].querySelectorAll("["+n+"]"),c))}),e.forEach(t,function(n){if(0===i.length){var r=" "+o.className+" ",t=u.exec(r);t?i.push((t[2]||"").replace(/\s+/g,",")):e.forEach(n.attributes,function(e){0===i.length&&s[e.name]&&i.push(e.value)})}})}0!==i.length||(n.jasmine||n.mocha)&&e.isDefined(e.mock)||console.error("No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.");var l=function d(n){if(-1===r.indexOf(n)){r.push(n);var o=e.module(n);$(null,o._invokeQueue,n),$(null,o._configBlocks,n),e.forEach(o.requires,d)}};e.forEach(i,function(e){l(e)}),i=[],a.pop()};var z=function(n){var r=[];return JSON.stringify(n,function(n,o){if(e.isObject(o)&&null!==o){if(-1!==r.indexOf(o))return;r.push(o)}return o})},D=function(e){var n,r,o,t=0;if(0==e.length)return t;for(n=0,o=e.length;o>n;n++)r=e.charCodeAt(n),t=(t<<5)-t+r,t|=0;return t};this.$get=["$log","$rootElement","$rootScope","$cacheFactory","$q",function(n,o,t,u,l){function d(e){var r=l.defer();return n.error(e.message),r.reject(e),r.promise}var g,p=u("ocLazyLoad");return O||(n={},n.error=e.noop,n.warn=e.noop,n.info=e.noop),w.getInstanceInjector=function(){return g?g:g=o.data("$injector")||e.injector()},s=function(e,r){b&&t.$broadcast(e,r),O&&n.info(e,r)},{_broadcast:s,_$log:n,_getFilesCache:function(){return p},toggleWatch:function(e){e?a.push(!0):a.pop()},getModuleConfig:function(n){if(!e.isString(n))throw new Error("You need to give the name of the module to get");return _[n]?e.copy(_[n]):null},setModuleConfig:function(n){if(!e.isObject(n))throw new Error("You need to give the module config object to set");return _[n.name]=n,n},getModules:function(){return r},isLoaded:function(n){var o=function(e){var n=r.indexOf(e)>-1;return n||(n=!!E(e)),n};if(e.isString(n)&&(n=[n]),e.isArray(n)){var t,i;for(t=0,i=n.length;i>t;t++)if(!o(n[t]))return!1;return!0}throw new Error("You need to define the module(s) name(s)")},_getModuleName:j,_getModule:function(e){try{return h(e)}catch(n){throw(/No module/.test(n)||n.message.indexOf("$injector:nomod")>-1)&&(n.message='The module "'+z(e)+'" that you are trying to load does not exist. '+n.message),n}},moduleExists:E,_loadDependencies:function(n,r){var o,t,i,a=[],s=this;if(n=s._getModuleName(n),null===n)return l.when();try{o=s._getModule(n)}catch(u){return d(u)}return t=s.getRequires(o),e.forEach(t,function(o){if(e.isString(o)){var t=s.getModuleConfig(o);if(null===t)return void x.push(o);o=t}if(s.moduleExists(o.name))return i=o.files.filter(function(e){return s.getModuleConfig(o.name).files.indexOf(e)<0}),0!==i.length&&s._$log.warn('Module "',n,'" attempted to redefine configuration for dependency. "',o.name,'"\n Additional Files Loaded:',i),e.isDefined(s.filesLoader)?void a.push(s.filesLoader(o,r).then(function(){return s._loadDependencies(o)})):d(new Error("Error: New dependencies need to be loaded from external files ("+o.files+"), but no loader has been defined."));if(e.isArray(o)?o={files:o}:e.isObject(o)&&o.hasOwnProperty("name")&&o.name&&(s.setModuleConfig(o),x.push(o.name)),e.isDefined(o.files)&&0!==o.files.length){if(!e.isDefined(s.filesLoader))return d(new Error('Error: the module "'+o.name+'" is defined in external files ('+o.files+"), but no loader has been defined."));a.push(s.filesLoader(o,r).then(function(){return s._loadDependencies(o)}))}}),l.all(a)},inject:function(n){var r=void 0===arguments[1]?{}:arguments[1],o=this,t=l.defer();if(e.isDefined(n)&&null!==n){if(e.isArray(n)){var a=[];return e.forEach(n,function(e){a.push(o.inject(e))}),l.all(a)}o._addToLoadList(o._getModuleName(n),!0)}if(i.length>0){var s=i.slice(),u=function d(e){x.push(e),o._loadDependencies(e,r).then(function(){try{c=[],y(w,x,r)}catch(e){return o._$log.error(e.message),void t.reject(e)}i.length>0?d(i.shift()):t.resolve(s)},function(e){t.reject(e)})};u(i.shift())}else t.resolve();return t.promise},getRequires:function(n){var o=[];return e.forEach(n.requires,function(e){-1===r.indexOf(e)&&o.push(e)}),o},_invokeQueue:$,_registerInvokeList:L,_register:y,_addToLoadList:f}}],this._init(e.element(n.document))}]);var d=e.bootstrap;e.bootstrap=function(n,r,o){return e.forEach(r.slice(),function(e){f(e,!0)}),d(n,r,o)};var f=function(n,r){(a.length>0||r)&&e.isString(n)&&-1===i.indexOf(n)&&i.push(n)},h=e.module;e.module=function(e,n,r){return f(e),h(e,n,r)}}(angular,window),function(e){"use strict";e.module("oc.lazyLoad").directive("ocLazyLoad",["$ocLazyLoad","$compile","$animate","$parse",function(n,r,o,t){return{restrict:"A",terminal:!0,priority:1e3,compile:function(i){var a=i[0].innerHTML;return i.html(""),function(s,u,c){var l=t(c.ocLazyLoad);s.$watch(function(){return l(s)||c.ocLazyLoad},function(t){e.isDefined(t)&&n.load(t).then(function(){o.enter(a,u);var n=i.contents();e.forEach(n,function(e){3!==e.nodeType&&r(e)(s)})})},!0)}}}}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q","$window","$interval",function(n,r,o,t){var i=!1,a=!1,s=o.document.getElementsByTagName("head")[0]||o.document.getElementsByTagName("body")[0];return n.buildElement=function(u,c,l){var d,f,h=r.defer(),g=n._getFilesCache(),p=function(e){var n=(new Date).getTime();return e.indexOf("?")>=0?"&"===e.substring(0,e.length-1)?""+e+"_dc="+n:""+e+"&_dc="+n:""+e+"?_dc="+n};switch(e.isUndefined(g.get(c))&&g.put(c,h.promise),u){case"css":d=o.document.createElement("link"),d.type="text/css",d.rel="stylesheet",d.href=l.cache===!1?p(c):c;break;case"js":d=o.document.createElement("script"),d.src=l.cache===!1?p(c):c;break;default:g.remove(c),h.reject(new Error('Requested type "'+u+'" is not known. Could not inject "'+c+'"'))}d.onload=d.onreadystatechange=function(){d.readyState&&!/^c|loade/.test(d.readyState)||f||(d.onload=d.onreadystatechange=null,f=1,n._broadcast("ocLazyLoad.fileLoaded",c),h.resolve())},d.onerror=function(){g.remove(c),h.reject(new Error("Unable to load "+c))},d.async=l.serie?0:1;var m=s.lastChild;if(l.insertBefore){var v=e.element(e.isDefined(window.jQuery)?l.insertBefore:document.querySelector(l.insertBefore));v&&v.length>0&&(m=v[0])}if(m.parentNode.insertBefore(d,m),"css"==u){if(!i){var y=o.navigator.userAgent.toLowerCase();if(/iP(hone|od|ad)/.test(o.navigator.platform)){var L=o.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),$=parseFloat([parseInt(L[1],10),parseInt(L[2],10),parseInt(L[3]||0,10)].join("."));a=6>$}else if(y.indexOf("android")>-1){var j=parseFloat(y.slice(y.indexOf("android")+8));a=4.4>j}else if(y.indexOf("safari")>-1){var E=y.match(/version\/([\.\d]+)/i);a=E&&E[1]&&parseFloat(E[1])<6}}if(a)var _=1e3,w=t(function(){try{d.sheet.cssRules,t.cancel(w),d.onload()}catch(e){--_<=0&&d.onerror()}},20)}return h.promise},n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.filesLoader=function(o){var t=void 0===arguments[1]?{}:arguments[1],i=[],a=[],s=[],u=[],c=null,l=n._getFilesCache();n.toggleWatch(!0),e.extend(t,o);var d=function(r){var o,d=null;if(e.isObject(r)&&(d=r.type,r=r.path),c=l.get(r),e.isUndefined(c)||t.cache===!1){if(null!==(o=/^(css|less|html|htm|js)?(?=!)/.exec(r))&&(d=o[1],r=r.substr(o[1].length+1,r.length)),!d)if(null!==(o=/[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(r)))d=o[1];else{if(n.jsLoader.hasOwnProperty("ocLazyLoadLoader")||!n.jsLoader.hasOwnProperty("load"))return void n._$log.error("File type could not be determined. "+r);d="js"}"css"!==d&&"less"!==d||-1!==i.indexOf(r)?"html"!==d&&"htm"!==d||-1!==a.indexOf(r)?"js"===d||-1===s.indexOf(r)?s.push(r):n._$log.error("File type is not valid. "+r):a.push(r):i.push(r)}else c&&u.push(c)};if(t.serie?d(t.files.shift()):e.forEach(t.files,function(e){d(e)}),i.length>0){var f=r.defer();n.cssLoader(i,function(r){e.isDefined(r)&&n.cssLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),f.reject(r)):f.resolve()},t),u.push(f.promise)}if(a.length>0){var h=r.defer();n.templatesLoader(a,function(r){e.isDefined(r)&&n.templatesLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),h.reject(r)):h.resolve()},t),u.push(h.promise)}if(s.length>0){var g=r.defer();n.jsLoader(s,function(r){e.isDefined(r)&&n.jsLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),g.reject(r)):g.resolve()},t),u.push(g.promise)}if(0===u.length){var p=r.defer(),m="Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.";return n._$log.error(m),p.reject(m),p.promise}return t.serie&&t.files.length>0?r.all(u).then(function(){return n.filesLoader(o,t)}):r.all(u)["finally"](function(e){return n.toggleWatch(!1),e})},n.load=function(o){var t,i=void 0===arguments[1]?{}:arguments[1],a=this,s=null,u=[],c=r.defer(),l=e.copy(o),d=e.copy(i);if(e.isArray(l))return e.forEach(l,function(e){u.push(a.load(e,d))}),r.all(u).then(function(e){c.resolve(e)},function(e){c.reject(e)}),c.promise;if(e.isString(l)?(s=a.getModuleConfig(l),s||(s={files:[l]})):e.isObject(l)&&(s=e.isDefined(l.path)&&e.isDefined(l.type)?{files:[l]}:a.setModuleConfig(l)),null===s){var f=a._getModuleName(l);return t='Module "'+(f||"unknown")+'" is not configured, cannot load.',n._$log.error(t),c.reject(new Error(t)),c.promise}e.isDefined(s.template)&&(e.isUndefined(s.files)&&(s.files=[]),e.isString(s.template)?s.files.push(s.template):e.isArray(s.template)&&s.files.concat(s.template));var h=e.extend({},d,s);return e.isUndefined(s.files)&&e.isDefined(s.name)&&n.moduleExists(s.name)?n.inject(s.name,h):(n.filesLoader(s,h).then(function(){n.inject(null,h).then(function(e){c.resolve(e)},function(e){c.reject(e)})},function(e){c.reject(e)}),c.promise)},n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.cssLoader=function(o,t,i){var a=[];e.forEach(o,function(e){a.push(n.buildElement("css",e,i))}),r.all(a).then(function(){t()},function(e){t(e)})},n.cssLoader.ocLazyLoadLoader=!0,n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(e){return e.jsLoader=require,e}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$templateCache","$q","$http",function(n,r,o,t){return n.templatesLoader=function(i,a,s){var u=[],c=n._getFilesCache();return e.forEach(i,function(n){var i=o.defer();u.push(i.promise),t.get(n,s).success(function(o){e.isString(o)&&o.length>0&&e.forEach(e.element(o),function(e){"SCRIPT"===e.nodeName&&"text/ng-template"===e.type&&r.put(e.id,e.innerHTML)}),e.isUndefined(c.get(n))&&c.put(n,!0),i.resolve()}).error(function(e){i.reject(new Error('Unable to load template file "'+n+'": '+e))})}),o.all(u).then(function(){a()},function(e){a(e)})},n.templatesLoader.ocLazyLoadLoader=!0,n}])}])}(angular),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,n){var r;if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),t=o.length>>>0;if(0===t)return-1;var i=+n||0;if(1/0===Math.abs(i)&&(i=0),i>=t)return-1;for(r=Math.max(i>=0?i:t-Math.abs(i),0);t>r;){if(r in o&&o[r]===e)return r;r++}return-1}); 9 | //# sourceMappingURL=ocLazyLoad.require.min.js.map -------------------------------------------------------------------------------- /bower_components/requirejs/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "requirejs", 3 | "version": "2.1.18", 4 | "homepage": "http://requirejs.org", 5 | "authors": [ 6 | "jrburke.com" 7 | ], 8 | "description": "A file and module loader for JavaScript", 9 | "main": "require.js", 10 | "keywords": [ 11 | "AMD" 12 | ], 13 | "license": [ 14 | "BSD-3-Clause", 15 | "MIT" 16 | ], 17 | "_release": "2.1.18", 18 | "_resolution": { 19 | "type": "version", 20 | "tag": "2.1.18", 21 | "commit": "833b2db37b0899f7f2c8b6ada741f49c3a7bfbe9" 22 | }, 23 | "_source": "git://github.com/jrburke/requirejs-bower.git", 24 | "_target": "~2.1.18", 25 | "_originalSource": "requirejs" 26 | } -------------------------------------------------------------------------------- /bower_components/requirejs/README.md: -------------------------------------------------------------------------------- 1 | # requirejs-bower 2 | 3 | Bower packaging for [RequireJS](http://requirejs.org). 4 | 5 | -------------------------------------------------------------------------------- /bower_components/requirejs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "requirejs", 3 | "version": "2.1.18", 4 | "homepage": "http://requirejs.org", 5 | "authors": [ 6 | "jrburke.com" 7 | ], 8 | "description": "A file and module loader for JavaScript", 9 | "main": "require.js", 10 | "keywords": [ 11 | "AMD" 12 | ], 13 | "license": [ 14 | "BSD-3-Clause", 15 | "MIT" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /bower_components/ui-router/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-ui-router", 3 | "version": "0.2.15", 4 | "main": "./release/angular-ui-router.js", 5 | "dependencies": { 6 | "angular": ">= 1.0.8" 7 | }, 8 | "ignore": [ 9 | "**/.*", 10 | "node_modules", 11 | "bower_components", 12 | "component.json", 13 | "package.json", 14 | "lib", 15 | "config", 16 | "sample", 17 | "test", 18 | "tests", 19 | "ngdoc_assets", 20 | "Gruntfile.js", 21 | "files.js" 22 | ], 23 | "homepage": "https://github.com/angular-ui/ui-router", 24 | "_release": "0.2.15", 25 | "_resolution": { 26 | "type": "version", 27 | "tag": "0.2.15", 28 | "commit": "805e69bae319e922e4d3265b7ef565058aaff850" 29 | }, 30 | "_source": "git://github.com/angular-ui/ui-router.git", 31 | "_target": "~0.2.15", 32 | "_originalSource": "ui-router" 33 | } -------------------------------------------------------------------------------- /bower_components/ui-router/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ### 0.2.14 (2015-04-23) 3 | 4 | 5 | #### Bug Fixes 6 | 7 | * **$StateRefDirective:** resolve missing support for svg anchor elements #1667 ([0149a7bb](https://github.com/angular-ui/ui-router/commit/0149a7bb38b7af99388a1ad7cc9909a7b7c4439d)) 8 | * **$urlMatcherFactory:** 9 | * regex params should respect case-sensitivity ([1e10519f](https://github.com/angular-ui/ui-router/commit/1e10519f3be6bbf0cefdcce623cd2ade06e649e5), closes [#1671](https://github.com/angular-ui/ui-router/issues/1671)) 10 | * unquote all dashes from array params ([06664d33](https://github.com/angular-ui/ui-router/commit/06664d330f882390655dcfa83e10276110d0d0fa)) 11 | * add Type.$normalize function ([b0c6aa23](https://github.com/angular-ui/ui-router/commit/b0c6aa2350fdd3ce8483144774adc12f5a72b7e9)) 12 | * make optional params regex grouping optional ([06f73794](https://github.com/angular-ui/ui-router/commit/06f737945e83e668d09cfc3bcffd04a500ff1963), closes [#1576](https://github.com/angular-ui/ui-router/issues/1576)) 13 | * **$state:** allow about.*.** glob patterns ([e39b27a2](https://github.com/angular-ui/ui-router/commit/e39b27a2cb7d88525c446a041f9fbf1553202010)) 14 | * **uiSref:** 15 | * use Object's toString instead of Window's toString ([2aa7f4d1](https://github.com/angular-ui/ui-router/commit/2aa7f4d139dbd5b9fcc4afdcf2ab6642c87f5671)) 16 | * add absolute to allowed transition options ([ae1b3c4e](https://github.com/angular-ui/ui-router/commit/ae1b3c4eedc37983400d830895afb50457c63af4)) 17 | * **uiSrefActive:** Apply active classes on lazy loaded states ([f0ddbe7b](https://github.com/angular-ui/ui-router/commit/f0ddbe7b4a91daf279c3b7d0cee732bb1f3be5b4)) 18 | * **uiView:** add `$element` to locals for view controller ([db68914c](https://github.com/angular-ui/ui-router/commit/db68914cd6c821e7dec8155bd33142a3a97f5453)) 19 | 20 | 21 | #### Features 22 | 23 | * **$state:** 24 | * support URLs with #fragments ([3da0a170](https://github.com/angular-ui/ui-router/commit/3da0a17069e27598c0f9d9164e104dd5ce05cdc6)) 25 | * inject resolve params into controllerProvider ([b380c223](https://github.com/angular-ui/ui-router/commit/b380c223fe12e2fde7582c0d6b1ed7b15a23579b), closes [#1131](https://github.com/angular-ui/ui-router/issues/1131)) 26 | * added 'state' to state reload method (feat no.1612) - modiefied options.reload ([b8f04575](https://github.com/angular-ui/ui-router/commit/b8f04575a8557035c1858c4d5c8dbde3e1855aaa)) 27 | * broadcast $stateChangeCancel event when event.preventDefault() is called in $sta ([ecefb758](https://github.com/angular-ui/ui-router/commit/ecefb758cb445e41620b62a272aafa3638613d7a)) 28 | * **$uiViewScroll:** change function to return promise ([c2a9a311](https://github.com/angular-ui/ui-router/commit/c2a9a311388bb212e5a2e820536d1d739f829ccd), closes [#1702](https://github.com/angular-ui/ui-router/issues/1702)) 29 | * **uiSrefActive:** Added support for multiple nested uiSref directives ([b1844948](https://github.com/angular-ui/ui-router/commit/b18449481d152b50705abfce2493a444eb059fa5)) 30 | 31 | 32 | 33 | ### 0.2.13 (2014-11-20) 34 | 35 | This release primarily fixes issues reported against 0.2.12 36 | 37 | #### Bug Fixes 38 | 39 | * **$state:** fix $state.includes/.is to apply param types before comparisions fix(uiSref): ma ([19715d15](https://github.com/angular-ui/ui-router/commit/19715d15e3cbfff724519e9febedd05b49c75baa), closes [#1513](https://github.com/angular-ui/ui-router/issues/1513)) 40 | * Avoid re-synchronizing from url after .transitionTo ([b267ecd3](https://github.com/angular-ui/ui-router/commit/b267ecd348e5c415233573ef95ebdbd051875f52), closes [#1573](https://github.com/angular-ui/ui-router/issues/1573)) 41 | * **$urlMatcherFactory:** 42 | * Built-in date type uses local time zone ([d726bedc](https://github.com/angular-ui/ui-router/commit/d726bedcbb5f70a5660addf43fd52ec730790293)) 43 | * make date type fn check .is before running ([aa94ce3b](https://github.com/angular-ui/ui-router/commit/aa94ce3b86632ad05301530a2213099da73a3dc0), closes [#1564](https://github.com/angular-ui/ui-router/issues/1564)) 44 | * early binding of array handler bypasses type resolution ([ada4bc27](https://github.com/angular-ui/ui-router/commit/ada4bc27df5eff3ba3ab0de94a09bd91b0f7a28c)) 45 | * add 'any' Type for non-encoding non-url params ([3bfd75ab](https://github.com/angular-ui/ui-router/commit/3bfd75ab445ee2f1dd55275465059ed116b10b27), closes [#1562](https://github.com/angular-ui/ui-router/issues/1562)) 46 | * fix encoding slashes in params ([0c983a08](https://github.com/angular-ui/ui-router/commit/0c983a08e2947f999683571477debd73038e95cf), closes [#1119](https://github.com/angular-ui/ui-router/issues/1119)) 47 | * fix mixed path/query params ordering problem ([a479fbd0](https://github.com/angular-ui/ui-router/commit/a479fbd0b8eb393a94320973e5b9a62d83912ee2), closes [#1543](https://github.com/angular-ui/ui-router/issues/1543)) 48 | * **ArrayType:** 49 | * specify empty array mapping corner case ([74aa6091](https://github.com/angular-ui/ui-router/commit/74aa60917e996b0b4e27bbb4eb88c3c03832021d), closes [#1511](https://github.com/angular-ui/ui-router/issues/1511)) 50 | * fix .equals for array types ([5e6783b7](https://github.com/angular-ui/ui-router/commit/5e6783b77af9a90ddff154f990b43dbb17eeda6e), closes [#1538](https://github.com/angular-ui/ui-router/issues/1538)) 51 | * **Param:** fix default value shorthand declaration ([831d812a](https://github.com/angular-ui/ui-router/commit/831d812a524524c71f0ee1c9afaf0487a5a66230), closes [#1554](https://github.com/angular-ui/ui-router/issues/1554)) 52 | * **common:** fixed the _.filter clone to not create sparse arrays ([750f5cf5](https://github.com/angular-ui/ui-router/commit/750f5cf5fd91f9ada96f39e50d39aceb2caf22b6), closes [#1563](https://github.com/angular-ui/ui-router/issues/1563)) 53 | * **ie8:** fix calls to indexOf and filter ([dcb31b84](https://github.com/angular-ui/ui-router/commit/dcb31b843391b3e61dee4de13f368c109541813e), closes [#1556](https://github.com/angular-ui/ui-router/issues/1556)) 54 | 55 | 56 | #### Features 57 | 58 | * add json parameter Type ([027f1fcf](https://github.com/angular-ui/ui-router/commit/027f1fcf9c0916cea651e88981345da6f9ff214a)) 59 | 60 | 61 | 62 | ### 0.2.12 (2014-11-13) 63 | 64 | #### Bug Fixes 65 | 66 | * **$resolve:** use resolve fn result, not parent resolved value of same name ([67f5e00c](https://github.com/angular-ui/ui-router/commit/67f5e00cc9aa006ce3fe6cde9dff261c28eab70a), closes [#1317], [#1353]) 67 | * **$state:** 68 | * populate default params in .transitionTo. ([3f60fbe6](https://github.com/angular-ui/ui-router/commit/3f60fbe6d65ebeca8d97952c05aa1d269f1b7ba1), closes [#1396]) 69 | * reload() now reinvokes controllers ([73443420](https://github.com/angular-ui/ui-router/commit/7344342018847902594dc1fc62d30a5c30f01763), closes [#582]) 70 | * do not emit $viewContentLoading if notify: false ([74255feb](https://github.com/angular-ui/ui-router/commit/74255febdf48ae082a02ca1e735165f2c369a463), closes [#1387](https://github.com/angular-ui/ui-router/issues/1387)) 71 | * register states at config-time ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a)) 72 | * handle parent.name when parent is obj ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a)) 73 | * **$urlMatcherFactory:** 74 | * register types at config ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a), closes [#1476]) 75 | * made path params default value "" for backwards compat ([8f998e71](https://github.com/angular-ui/ui-router/commit/8f998e71e43a0b31293331c981f5db0f0097b8ba)) 76 | * Pre-replace certain param values for better mapping ([6374a3e2](https://github.com/angular-ui/ui-router/commit/6374a3e29ab932014a7c77d2e1ab884cc841a2e3)) 77 | * fixed ParamSet.$$keys() ordering ([9136fecb](https://github.com/angular-ui/ui-router/commit/9136fecbc2bfd4fda748a9914f0225a46c933860)) 78 | * empty string policy now respected in Param.value() ([db12c85c](https://github.com/angular-ui/ui-router/commit/db12c85c16f2d105415f9bbbdeb11863f64728e0)) 79 | * "string" type now encodes/decodes slashes ([3045e415](https://github.com/angular-ui/ui-router/commit/3045e41577a8b8b8afc6039f42adddf5f3c061ec), closes [#1119]) 80 | * allow arrays in both path and query params ([fdd2f2c1](https://github.com/angular-ui/ui-router/commit/fdd2f2c191c4a67c874fdb9ec9a34f8dde9ad180), closes [#1073], [#1045], [#1486], [#1394]) 81 | * typed params in search ([8d4cab69](https://github.com/angular-ui/ui-router/commit/8d4cab69dd67058e1a716892cc37b7d80a57037f), closes [#1488](https://github.com/angular-ui/ui-router/issues/1488)) 82 | * no longer generate unroutable urls ([cb9fd9d8](https://github.com/angular-ui/ui-router/commit/cb9fd9d8943cb26c7223f6990db29c82ae8740f8), closes [#1487](https://github.com/angular-ui/ui-router/issues/1487)) 83 | * handle optional parameter followed by required parameter in url format. ([efc72106](https://github.com/angular-ui/ui-router/commit/efc72106ddcc4774b48ea176a505ef9e95193b41)) 84 | * default to parameter string coersion. ([13a468a7](https://github.com/angular-ui/ui-router/commit/13a468a7d54c2fb0751b94c0c1841d580b71e6dc), closes [#1414](https://github.com/angular-ui/ui-router/issues/1414)) 85 | * concat respects strictMode/caseInsensitive ([dd72e103](https://github.com/angular-ui/ui-router/commit/dd72e103edb342d9cf802816fe127e1bbd68fd5f), closes [#1395]) 86 | * **ui-sref:** 87 | * Allow sref state options to take a scope object ([b5f7b596](https://github.com/angular-ui/ui-router/commit/b5f7b59692ce4933e2d63eb5df3f50a4ba68ccc0)) 88 | * replace raw href modification with attrs. ([08c96782](https://github.com/angular-ui/ui-router/commit/08c96782faf881b0c7ab00afc233ee6729548fa0)) 89 | * nagivate to state when url is "" fix($state.href): generate href for state with ([656b5aab](https://github.com/angular-ui/ui-router/commit/656b5aab906e5749db9b5a080c6a83b95f50fd91), closes [#1363](https://github.com/angular-ui/ui-router/issues/1363)) 90 | * Check that state is defined in isMatch() ([92aebc75](https://github.com/angular-ui/ui-router/commit/92aebc7520f88babdc6e266536086e07263514c3), closes [#1314](https://github.com/angular-ui/ui-router/issues/1314), [#1332](https://github.com/angular-ui/ui-router/issues/1332)) 91 | * **uiView:** 92 | * allow inteprolated ui-view names ([81f6a19a](https://github.com/angular-ui/ui-router/commit/81f6a19a432dac9198fd33243855bfd3b4fea8c0), closes [#1324](https://github.com/angular-ui/ui-router/issues/1324)) 93 | * Made anim work with angular 1.3 ([c3bb7ad9](https://github.com/angular-ui/ui-router/commit/c3bb7ad903da1e1f3c91019cfd255be8489ff4ef), closes [#1367](https://github.com/angular-ui/ui-router/issues/1367), [#1345](https://github.com/angular-ui/ui-router/issues/1345)) 94 | * **urlRouter:** html5Mode accepts an object from angular v1.3.0-rc.3 ([7fea1e9d](https://github.com/angular-ui/ui-router/commit/7fea1e9d0d8c6e09cc6c895ecb93d4221e9adf48)) 95 | * **stateFilters:** mark state filters as stateful. ([a00b353e](https://github.com/angular-ui/ui-router/commit/a00b353e3036f64a81245c4e7898646ba218f833), closes [#1479]) 96 | * **ui-router:** re-add IE8 compatibility for map/filter/keys ([8ce69d9f](https://github.com/angular-ui/ui-router/commit/8ce69d9f7c886888ab53eca7e53536f36b428aae), closes [#1518], [#1383]) 97 | * **package:** point 'main' to a valid filename ([ac903350](https://github.com/angular-ui/ui-router/commit/ac9033501debb63364539d91fbf3a0cba4579f8e)) 98 | * **travis:** make CI build faster ([0531de05](https://github.com/angular-ui/ui-router/commit/0531de052e414a8d839fbb4e7635e923e94865b3)) 99 | 100 | 101 | #### Features 102 | 103 | ##### Default and Typed params 104 | 105 | This release includes a lot of bug fixes around default/optional and typed parameters. As such, 0.2.12 is the first release where we recommend those features be used. 106 | 107 | * **$state:** 108 | * add state params validation ([b1379e6a](https://github.com/angular-ui/ui-router/commit/b1379e6a4d38f7ed7436e05873932d7c279af578), closes [#1433](https://github.com/angular-ui/ui-router/issues/1433)) 109 | * is/includes/get work on relative stateOrName ([232e94b3](https://github.com/angular-ui/ui-router/commit/232e94b3c2ca2c764bb9510046e4b61690c87852)) 110 | * .reload() returns state transition promise ([639e0565](https://github.com/angular-ui/ui-router/commit/639e0565dece9d5544cc93b3eee6e11c99bd7373)) 111 | * **$templateFactory:** request templateURL as text/html ([ccd60769](https://github.com/angular-ui/ui-router/commit/ccd6076904a4b801d77b47f6e2de4c06ce9962f8), closes [#1287]) 112 | * **$urlMatcherFactory:** Made a Params and ParamSet class ([0cc1e6cc](https://github.com/angular-ui/ui-router/commit/0cc1e6cc461a4640618e2bb594566551c54834e2)) 113 | 114 | 115 | 116 | 117 | ### 0.2.11 (2014-08-26) 118 | 119 | 120 | #### Bug Fixes 121 | 122 | * **$resolve:** Resolves only inherit from immediate parent fixes #702 ([df34e20c](https://github.com/angular-ui/ui-router/commit/df34e20c576299e7a3c8bd4ebc68d42341c0ace9)) 123 | * **$state:** 124 | * change $state.href default options.inherit to true ([deea695f](https://github.com/angular-ui/ui-router/commit/deea695f5cacc55de351ab985144fd233c02a769)) 125 | * sanity-check state lookups ([456fd5ae](https://github.com/angular-ui/ui-router/commit/456fd5aec9ea507518927bfabd62b4afad4cf714), closes [#980](https://github.com/angular-ui/ui-router/issues/980)) 126 | * didn't comply to inherit parameter ([09836781](https://github.com/angular-ui/ui-router/commit/09836781f126c1c485b06551eb9cfd4fa0f45c35)) 127 | * allow view content loading broadcast ([7b78edee](https://github.com/angular-ui/ui-router/commit/7b78edeeb52a74abf4d3f00f79534033d5a08d1a)) 128 | * **$urlMatcherFactory:** 129 | * detect injected functions ([91f75ae6](https://github.com/angular-ui/ui-router/commit/91f75ae66c4d129f6f69e53bd547594e9661f5d5)) 130 | * syntax ([1ebed370](https://github.com/angular-ui/ui-router/commit/1ebed37069bae8614d41541d56521f5c45f703f3)) 131 | * **UrlMatcher:** 132 | * query param function defaults ([f9c20530](https://github.com/angular-ui/ui-router/commit/f9c205304f10d8a4ebe7efe9025e642016479a51)) 133 | * don't decode default values ([63607bdb](https://github.com/angular-ui/ui-router/commit/63607bdbbcb432d3fb37856a1cb3da0cd496804e)) 134 | * **travis:** update Node version to fix build ([d6b95ef2](https://github.com/angular-ui/ui-router/commit/d6b95ef23d9dacb4eba08897f5190a0bcddb3a48)) 135 | * **uiSref:** 136 | * Generate an href for states with a blank url. closes #1293 ([691745b1](https://github.com/angular-ui/ui-router/commit/691745b12fa05d3700dd28f0c8d25f8a105074ad)) 137 | * should inherit params by default ([b973dad1](https://github.com/angular-ui/ui-router/commit/b973dad155ad09a7975e1476bd096f7b2c758eeb)) 138 | * cancel transition if preventDefault() has been called ([2e6d9167](https://github.com/angular-ui/ui-router/commit/2e6d9167d3afbfbca6427e53e012f94fb5fb8022)) 139 | * **uiView:** Fixed infinite loop when is called .go() from a controller. ([e13988b8](https://github.com/angular-ui/ui-router/commit/e13988b8cd6231d75c78876ee9d012cc87f4a8d9), closes [#1194](https://github.com/angular-ui/ui-router/issues/1194)) 140 | * **docs:** 141 | * Fixed link to milestones ([6c0ae500](https://github.com/angular-ui/ui-router/commit/6c0ae500cc238ea9fc95adcc15415c55fc9e1f33)) 142 | * fix bug in decorator example ([4bd00af5](https://github.com/angular-ui/ui-router/commit/4bd00af50b8b88a49d1545a76290731cb8e0feb1)) 143 | * Removed an incorrect semi-colon ([af97cef8](https://github.com/angular-ui/ui-router/commit/af97cef8b967f2e32177e539ef41450dca131a7d)) 144 | * Explain return value of rule as function ([5e887890](https://github.com/angular-ui/ui-router/commit/5e8878900a6ffe59a81aed531a3925e34a297377)) 145 | 146 | 147 | #### Features 148 | 149 | * **$state:** 150 | * allow parameters to pass unharmed ([8939d057](https://github.com/angular-ui/ui-router/commit/8939d0572ab1316e458ef016317ecff53131a822)) 151 | * **BREAKING CHANGE**: state parameters are no longer automatically coerced to strings, and unspecified parameter values are now set to undefined rather than null. 152 | * allow prevent syncUrl on failure ([753060b9](https://github.com/angular-ui/ui-router/commit/753060b910d5d2da600a6fa0757976e401c33172)) 153 | * **typescript:** Add typescript definitions for component builds ([521ceb3f](https://github.com/angular-ui/ui-router/commit/521ceb3fd7850646422f411921e21ce5e7d82e0f)) 154 | * **uiSref:** extend syntax for ui-sref ([71cad3d6](https://github.com/angular-ui/ui-router/commit/71cad3d636508b5a9fe004775ad1f1adc0c80c3e)) 155 | * **uiSrefActive:** 156 | * Also activate for child states. ([bf163ad6](https://github.com/angular-ui/ui-router/commit/bf163ad6ce176ce28792696c8302d7cdf5c05a01), closes [#818](https://github.com/angular-ui/ui-router/issues/818)) 157 | * **BREAKING CHANGE** Since ui-sref-active now activates even when child states are active you may need to swap out your ui-sref-active with ui-sref-active-eq, thought typically we think devs want the auto inheritance. 158 | 159 | * uiSrefActiveEq: new directive with old ui-sref-active behavior 160 | * **$urlRouter:** 161 | * defer URL change interception ([c72d8ce1](https://github.com/angular-ui/ui-router/commit/c72d8ce11916d0ac22c81b409c9e61d7048554d7)) 162 | * force URLs to have valid params ([d48505cd](https://github.com/angular-ui/ui-router/commit/d48505cd328d83e39d5706e085ba319715f999a6)) 163 | * abstract $location handling ([08b4636b](https://github.com/angular-ui/ui-router/commit/08b4636b294611f08db35f00641eb5211686fb50)) 164 | * **$urlMatcherFactory:** 165 | * fail on bad parameters ([d8f124c1](https://github.com/angular-ui/ui-router/commit/d8f124c10d00c7e5dde88c602d966db261aea221)) 166 | * date type support ([b7f074ff](https://github.com/angular-ui/ui-router/commit/b7f074ff65ca150a3cdbda4d5ad6cb17107300eb)) 167 | * implement type support ([450b1f0e](https://github.com/angular-ui/ui-router/commit/450b1f0e8e03c738174ff967f688b9a6373290f4)) 168 | * **UrlMatcher:** 169 | * handle query string arrays ([9cf764ef](https://github.com/angular-ui/ui-router/commit/9cf764efab45fa9309368688d535ddf6e96d6449), closes [#373](https://github.com/angular-ui/ui-router/issues/373)) 170 | * injectable functions as defaults ([00966ecd](https://github.com/angular-ui/ui-router/commit/00966ecd91fb745846039160cab707bfca8b3bec)) 171 | * default values & type decoding for query params ([a472b301](https://github.com/angular-ui/ui-router/commit/a472b301389fbe84d1c1fa9f24852b492a569d11)) 172 | * allow shorthand definitions ([5b724304](https://github.com/angular-ui/ui-router/commit/5b7243049793505e44b6608ea09878c37c95b1f5)) 173 | * validates whole interface ([32b27db1](https://github.com/angular-ui/ui-router/commit/32b27db173722e9194ef1d5c0ea7d93f25a98d11)) 174 | * implement non-strict matching ([a3e21366](https://github.com/angular-ui/ui-router/commit/a3e21366bee0475c9795a1ec76f70eec41c5b4e3)) 175 | * add per-param config support ([07b3029f](https://github.com/angular-ui/ui-router/commit/07b3029f4d409cf955780113df92e36401b47580)) 176 | * **BREAKING CHANGE**: the `params` option in state configurations must now be an object keyed by parameter name. 177 | 178 | ### 0.2.10 (2014-03-12) 179 | 180 | 181 | #### Bug Fixes 182 | 183 | * **$state:** use $browser.baseHref() when generating urls with .href() ([cbcc8488](https://github.com/angular-ui/ui-router/commit/cbcc84887d6b6d35258adabb97c714cd9c1e272d)) 184 | * **bower.json:** JS files should not be ignored ([ccdab193](https://github.com/angular-ui/ui-router/commit/ccdab193315f304eb3be5f5b97c47a926c79263e)) 185 | * **dev:** karma:background task is missing, can't run grunt:dev. ([d9f7b898](https://github.com/angular-ui/ui-router/commit/d9f7b898e8e3abb8c846b0faa16a382913d7b22b)) 186 | * **sample:** Contacts menu button not staying active when navigating to detail states. Need t ([2fcb8443](https://github.com/angular-ui/ui-router/commit/2fcb84437cb43ade12682a92b764f13cac77dfe7)) 187 | * **uiSref:** support mock-clicks/events with no data ([717d3ff7](https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418)) 188 | * **uiView:** 189 | * Do NOT autoscroll when autoscroll attr is missing ([affe5bd7](https://github.com/angular-ui/ui-router/commit/affe5bd785cdc3f02b7a9f64a52e3900386ec3a0), closes [#807](https://github.com/angular-ui/ui-router/issues/807)) 190 | * Refactoring uiView directive to copy ngView logic ([548fab6a](https://github.com/angular-ui/ui-router/commit/548fab6ab9debc9904c5865c8bc68b4fc3271dd0), closes [#857](https://github.com/angular-ui/ui-router/issues/857), [#552](https://github.com/angular-ui/ui-router/issues/552)) 191 | 192 | 193 | #### Features 194 | 195 | * **$state:** includes() allows glob patterns for state matching. ([2d5f6b37](https://github.com/angular-ui/ui-router/commit/2d5f6b37191a3135f4a6d9e8f344c54edcdc065b)) 196 | * **UrlMatcher:** Add support for case insensitive url matching ([642d5247](https://github.com/angular-ui/ui-router/commit/642d524799f604811e680331002feec7199a1fb5)) 197 | * **uiSref:** add support for transition options ([2ed7a728](https://github.com/angular-ui/ui-router/commit/2ed7a728cee6854b38501fbc1df6139d3de5b28a)) 198 | * **uiView:** add controllerAs config with function ([1ee7334a](https://github.com/angular-ui/ui-router/commit/1ee7334a73efeccc9b95340e315cdfd59944762d)) 199 | 200 | 201 | ### 0.2.9 (2014-01-17) 202 | 203 | 204 | This release is identical to 0.2.8. 0.2.8 was re-tagged in git to fix a problem with bower. 205 | 206 | 207 | ### 0.2.8 (2014-01-16) 208 | 209 | 210 | #### Bug Fixes 211 | 212 | * **$state:** allow null to be passed as 'params' param ([094dc30e](https://github.com/angular-ui/ui-router/commit/094dc30e883e1bd14e50a475553bafeaade3b178)) 213 | * **$state.go:** param inheritance shouldn't inherit from siblings ([aea872e0](https://github.com/angular-ui/ui-router/commit/aea872e0b983cb433436ce5875df10c838fccedb)) 214 | * **bower.json:** fixes bower.json ([eed3cc4d](https://github.com/angular-ui/ui-router/commit/eed3cc4d4dfef1d3ef84b9fd063127538ebf59d3)) 215 | * **uiSrefActive:** annotate controller injection ([85921422](https://github.com/angular-ui/ui-router/commit/85921422ff7fb0effed358136426d616cce3d583), closes [#671](https://github.com/angular-ui/ui-router/issues/671)) 216 | * **uiView:** 217 | * autoscroll tests pass on 1.2.4 & 1.1.5 ([86eacac0](https://github.com/angular-ui/ui-router/commit/86eacac09ca5e9000bd3b9c7ba6e2cc95d883a3a)) 218 | * don't animate initial load ([83b6634d](https://github.com/angular-ui/ui-router/commit/83b6634d27942ca74766b2b1244a7fc52c5643d9)) 219 | * test pass against 1.0.8 and 1.2.4 ([a402415a](https://github.com/angular-ui/ui-router/commit/a402415a2a28b360c43b9fe8f4f54c540f6c33de)) 220 | * it should autoscroll when expr is missing. ([8bb9e27a](https://github.com/angular-ui/ui-router/commit/8bb9e27a2986725f45daf44c4c9f846385095aff)) 221 | 222 | 223 | #### Features 224 | 225 | * **uiSref:** add target attribute behaviour ([c12bf9a5](https://github.com/angular-ui/ui-router/commit/c12bf9a520d30d70294e3d82de7661900f8e394e)) 226 | * **uiView:** 227 | * merge autoscroll expression test. ([b89e0f87](https://github.com/angular-ui/ui-router/commit/b89e0f871d5cc35c10925ede986c10684d5c9252)) 228 | * cache and test autoscroll expression ([ee262282](https://github.com/angular-ui/ui-router/commit/ee2622828c2ce83807f006a459ac4e11406d9258)) 229 | -------------------------------------------------------------------------------- /bower_components/ui-router/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Report an Issue 3 | 4 | Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure 5 | it hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues) 6 | to see if someone's reported one similar to yours. 7 | 8 | If not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code 9 | as possible: the more minimalist, the faster we can debug it). 10 | 11 | Next, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem, 12 | and provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to 13 | that plunkr you created! 14 | 15 | **Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure 16 | is a bug, it's best to talk it out on 17 | [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This 18 | keeps development streamlined, and helps us focus on building great software. 19 | 20 | 21 | Issues only! | 22 | -------------| 23 | Please keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs). | 24 | 25 | ####Purple Labels 26 | A purple label means that **you** need to take some further action. 27 | - ![Not Actionable - Need Info](http://angular-ui.github.io/ui-router/images/notactionable.png): Your issue is not specific enough, or there is no clear action that we can take. Please clarify and refine your issue. 28 | - ![Plunkr Please](http://angular-ui.github.io/ui-router/images/plunkrplease.png): Please [create a plunkr](http://bit.ly/UIR-Plunk) 29 | - ![StackOverflow](http://angular-ui.github.io/ui-router/images/stackoverflow.png): We suspect your issue is really a help request, or could be answered by the community. Please ask your question on [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router). If you determine that is an actual issue, please explain why. 30 | 31 | If your issue gets labeled with purple label, no further action will be taken until you respond to the label appropriately. 32 | 33 | # Contribute 34 | 35 | **(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine. 36 | 37 | **(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/milestones) to see where the project is headed, and if your feature idea fits with where we're headed. 38 | 39 | **(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea. 40 | 41 | **(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules: 42 | 43 | - *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests 44 | - Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one 45 | - Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release. 46 | - Changes should always respect the coding style of the project 47 | 48 | 49 | 50 | # Developing 51 | 52 | UI-Router uses grunt >= 0.4.x. Make sure to upgrade your environment and read the 53 | [Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4). 54 | 55 | Dependencies for building from source and running tests: 56 | 57 | * [grunt-cli](https://github.com/gruntjs/grunt-cli) - run: `$ npm install -g grunt-cli` 58 | * Then, install the development dependencies by running `$ npm install` from the project directory 59 | 60 | There are a number of targets in the gruntfile that are used to generating different builds: 61 | 62 | * `grunt`: Perform a normal build, runs jshint and karma tests 63 | * `grunt build`: Perform a normal build 64 | * `grunt dist`: Perform a clean build and generate documentation 65 | * `grunt dev`: Run dev server (sample app) and watch for changes, builds and runs karma tests on changes. 66 | -------------------------------------------------------------------------------- /bower_components/ui-router/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2013-2015 The AngularUI Team, Karsten Sperling 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /bower_components/ui-router/README.md: -------------------------------------------------------------------------------- 1 | # AngularUI Router  [![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router) 2 | 3 | #### The de-facto solution to flexible routing with nested views 4 | --- 5 | **[Download 0.2.15](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|** 6 | **[Guide](https://github.com/angular-ui/ui-router/wiki) |** 7 | **[API](http://angular-ui.github.io/ui-router/site) |** 8 | **[Sample](http://angular-ui.github.com/ui-router/sample/) ([Src](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) |** 9 | **[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |** 10 | **[Resources](#resources) |** 11 | **[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |** 12 | **[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |** 13 | **[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |** 14 | **[Discuss](https://groups.google.com/forum/#!categories/angular-ui/router)** 15 | 16 | --- 17 | 18 | AngularUI Router is a routing framework for [AngularJS](http://angularjs.org), which allows you to organize the 19 | parts of your interface into a [*state machine*](https://en.wikipedia.org/wiki/Finite-state_machine). Unlike the 20 | [`$route` service](http://docs.angularjs.org/api/ngRoute.$route) in the Angular ngRoute module, which is organized around URL 21 | routes, UI-Router is organized around [*states*](https://github.com/angular-ui/ui-router/wiki), 22 | which may optionally have routes, as well as other behavior, attached. 23 | 24 | States are bound to *named*, *nested* and *parallel views*, allowing you to powerfully manage your application's interface. 25 | 26 | Check out the sample app: http://angular-ui.github.io/ui-router/sample/ 27 | 28 | - 29 | **Note:** *UI-Router is under active development. As such, while this library is well-tested, the API may change. Consider using it in production applications only if you're comfortable following a changelog and updating your usage accordingly.* 30 | 31 | 32 | ## Get Started 33 | 34 | **(1)** Get UI-Router in one of the following ways: 35 | - clone & [build](CONTRIBUTING.md#developing) this repository 36 | - [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)) 37 | - [link to cdn](http://cdnjs.com/libraries/angular-ui-router) 38 | - via **[jspm](http://jspm.io/)**: by running `$ jspm install angular-ui-router` from your console 39 | - or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console 40 | - or via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console 41 | - or via **[Component](https://github.com/component/component)**: by running `$ component install angular-ui/ui-router` from your console 42 | 43 | **(2)** Include `angular-ui-router.js` (or `angular-ui-router.min.js`) in your `index.html`, after including Angular itself (For Component users: ignore this step) 44 | 45 | **(3)** Add `'ui.router'` to your main module's list of dependencies (For Component users: replace `'ui.router'` with `require('angular-ui-router')`) 46 | 47 | When you're done, your setup should look similar to the following: 48 | 49 | > 50 | ```html 51 | 52 | 53 | 54 | 55 | 56 | 61 | ... 62 | 63 | 64 | ... 65 | 66 | 67 | ``` 68 | 69 | ### [Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview) 70 | 71 | The majority of UI-Router's power is in its ability to nest states & views. 72 | 73 | **(1)** First, follow the [setup](#get-started) instructions detailed above. 74 | 75 | **(2)** Then, add a [`ui-view` directive](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view) to the `` of your app. 76 | 77 | > 78 | ```html 79 | 80 | 81 |
82 | 83 | State 1 84 | State 2 85 | 86 | ``` 87 | 88 | **(3)** You'll notice we also added some links with [`ui-sref` directives](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref). In addition to managing state transitions, this directive auto-generates the `href` attribute of the `` element it's attached to, if the corresponding state has a URL. Next we'll add some templates. These will plug into the `ui-view` within `index.html`. Notice that they have their own `ui-view` as well! That is the key to nesting states and views. 89 | 90 | > 91 | ```html 92 | 93 |

State 1

94 |
95 |
Show List 96 |
97 | ``` 98 | ```html 99 | 100 |

State 2

101 |
102 | Show List 103 |
104 | ``` 105 | 106 | **(4)** Next, we'll add some child templates. *These* will get plugged into the `ui-view` of their parent state templates. 107 | 108 | > 109 | ```html 110 | 111 |

List of State 1 Items

112 |
    113 |
  • {{ item }}
  • 114 |
115 | ``` 116 | 117 | > 118 | ```html 119 | 120 |

List of State 2 Things

121 |
    122 |
  • {{ thing }}
  • 123 |
124 | ``` 125 | 126 | **(5)** Finally, we'll wire it all up with `$stateProvider`. Set up your states in the module config, as in the following: 127 | 128 | 129 | > 130 | ```javascript 131 | myApp.config(function($stateProvider, $urlRouterProvider) { 132 | // 133 | // For any unmatched url, redirect to /state1 134 | $urlRouterProvider.otherwise("/state1"); 135 | // 136 | // Now set up the states 137 | $stateProvider 138 | .state('state1', { 139 | url: "/state1", 140 | templateUrl: "partials/state1.html" 141 | }) 142 | .state('state1.list', { 143 | url: "/list", 144 | templateUrl: "partials/state1.list.html", 145 | controller: function($scope) { 146 | $scope.items = ["A", "List", "Of", "Items"]; 147 | } 148 | }) 149 | .state('state2', { 150 | url: "/state2", 151 | templateUrl: "partials/state2.html" 152 | }) 153 | .state('state2.list', { 154 | url: "/list", 155 | templateUrl: "partials/state2.list.html", 156 | controller: function($scope) { 157 | $scope.things = ["A", "Set", "Of", "Things"]; 158 | } 159 | }); 160 | }); 161 | ``` 162 | 163 | **(6)** See this quick start example in action. 164 | >**[Go to Quick Start Plunker for Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)** 165 | 166 | **(7)** This only scratches the surface 167 | >**[Dive Deeper!](https://github.com/angular-ui/ui-router/wiki)** 168 | 169 | 170 | ### [Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview) 171 | 172 | Another great feature is the ability to have multiple `ui-view`s view per template. 173 | 174 | **Pro Tip:** *While multiple parallel views are a powerful feature, you'll often be able to manage your 175 | interfaces more effectively by nesting your views, and pairing those views with nested states.* 176 | 177 | **(1)** Follow the [setup](#get-started) instructions detailed above. 178 | 179 | **(2)** Add one or more `ui-view` to your app, give them names. 180 | > 181 | ```html 182 | 183 | 184 |
185 |
186 | 187 | Route 1 188 | Route 2 189 | 190 | ``` 191 | 192 | **(3)** Set up your states in the module config: 193 | > 194 | ```javascript 195 | myApp.config(function($stateProvider) { 196 | $stateProvider 197 | .state('index', { 198 | url: "", 199 | views: { 200 | "viewA": { template: "index.viewA" }, 201 | "viewB": { template: "index.viewB" } 202 | } 203 | }) 204 | .state('route1', { 205 | url: "/route1", 206 | views: { 207 | "viewA": { template: "route1.viewA" }, 208 | "viewB": { template: "route1.viewB" } 209 | } 210 | }) 211 | .state('route2', { 212 | url: "/route2", 213 | views: { 214 | "viewA": { template: "route2.viewA" }, 215 | "viewB": { template: "route2.viewB" } 216 | } 217 | }) 218 | }); 219 | ``` 220 | 221 | **(4)** See this quick start example in action. 222 | >**[Go to Quick Start Plunker for Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)** 223 | 224 | 225 | ## Resources 226 | 227 | * [In-Depth Guide](https://github.com/angular-ui/ui-router/wiki) 228 | * [API Reference](http://angular-ui.github.io/ui-router/site) 229 | * [Sample App](http://angular-ui.github.com/ui-router/sample/) ([Source](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) 230 | * [FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) 231 | * [Slides comparing ngRoute to ui-router](http://slid.es/timkindberg/ui-router#/) 232 | * [UI-Router Extras / Addons](http://christopherthielen.github.io/ui-router-extras/#/home) (@christopherthielen) 233 | 234 | ### Videos 235 | 236 | * [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io) 237 | * [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg) 238 | * [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io) 239 | * [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy) 240 | 241 | 242 | 243 | ## Reporting issues and Contributing 244 | 245 | Please read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request. 246 | -------------------------------------------------------------------------------- /bower_components/ui-router/api/angular-ui-router.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Angular JS 1.1.5+ (ui.router module) 2 | // Project: https://github.com/angular-ui/ui-router 3 | // Definitions by: Michel Salib 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | declare module ng.ui { 7 | 8 | interface IState { 9 | name?: string; 10 | template?: string; 11 | templateUrl?: any; // string || () => string 12 | templateProvider?: any; // () => string || IPromise 13 | controller?: any; 14 | controllerAs?: string; 15 | controllerProvider?: any; 16 | resolve?: {}; 17 | url?: string; 18 | params?: any; 19 | views?: {}; 20 | abstract?: boolean; 21 | onEnter?: (...args: any[]) => void; 22 | onExit?: (...args: any[]) => void; 23 | data?: any; 24 | reloadOnSearch?: boolean; 25 | } 26 | 27 | interface ITypedState extends IState { 28 | data?: T; 29 | } 30 | 31 | interface IStateProvider extends IServiceProvider { 32 | state(name: string, config: IState): IStateProvider; 33 | state(config: IState): IStateProvider; 34 | decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any; 35 | } 36 | 37 | interface IUrlMatcher { 38 | concat(pattern: string): IUrlMatcher; 39 | exec(path: string, searchParams: {}): {}; 40 | parameters(): string[]; 41 | format(values: {}): string; 42 | } 43 | 44 | interface IUrlMatcherFactory { 45 | compile(pattern: string): IUrlMatcher; 46 | isMatcher(o: any): boolean; 47 | } 48 | 49 | interface IUrlRouterProvider extends IServiceProvider { 50 | when(whenPath: RegExp, handler: Function): IUrlRouterProvider; 51 | when(whenPath: RegExp, handler: any[]): IUrlRouterProvider; 52 | when(whenPath: RegExp, toPath: string): IUrlRouterProvider; 53 | when(whenPath: IUrlMatcher, hanlder: Function): IUrlRouterProvider; 54 | when(whenPath: IUrlMatcher, handler: any[]): IUrlRouterProvider; 55 | when(whenPath: IUrlMatcher, toPath: string): IUrlRouterProvider; 56 | when(whenPath: string, handler: Function): IUrlRouterProvider; 57 | when(whenPath: string, handler: any[]): IUrlRouterProvider; 58 | when(whenPath: string, toPath: string): IUrlRouterProvider; 59 | otherwise(handler: Function): IUrlRouterProvider; 60 | otherwise(handler: any[]): IUrlRouterProvider; 61 | otherwise(path: string): IUrlRouterProvider; 62 | rule(handler: Function): IUrlRouterProvider; 63 | rule(handler: any[]): IUrlRouterProvider; 64 | } 65 | 66 | interface IStateOptions { 67 | location?: any; 68 | inherit?: boolean; 69 | relative?: IState; 70 | notify?: boolean; 71 | reload?: boolean; 72 | } 73 | 74 | interface IHrefOptions { 75 | lossy?: boolean; 76 | inherit?: boolean; 77 | relative?: IState; 78 | absolute?: boolean; 79 | } 80 | 81 | interface IStateService { 82 | go(to: string, params?: {}, options?: IStateOptions): IPromise; 83 | transitionTo(state: string, params?: {}, updateLocation?: boolean): void; 84 | transitionTo(state: string, params?: {}, options?: IStateOptions): void; 85 | includes(state: string, params?: {}): boolean; 86 | is(state:string, params?: {}): boolean; 87 | is(state: IState, params?: {}): boolean; 88 | href(state: IState, params?: {}, options?: IHrefOptions): string; 89 | href(state: string, params?: {}, options?: IHrefOptions): string; 90 | get(state: string): IState; 91 | get(): IState[]; 92 | current: IState; 93 | params: any; 94 | reload(): void; 95 | } 96 | 97 | interface IStateParamsService { 98 | [key: string]: any; 99 | } 100 | 101 | interface IStateParams { 102 | [key: string]: any; 103 | } 104 | 105 | interface IUrlRouterService { 106 | /* 107 | * Triggers an update; the same update that happens when the address bar 108 | * url changes, aka $locationChangeSuccess. 109 | * 110 | * This method is useful when you need to use preventDefault() on the 111 | * $locationChangeSuccess event, perform some custom logic (route protection, 112 | * auth, config, redirection, etc) and then finally proceed with the transition 113 | * by calling $urlRouter.sync(). 114 | * 115 | */ 116 | sync(): void; 117 | } 118 | 119 | interface IUiViewScrollProvider { 120 | /* 121 | * Reverts back to using the core $anchorScroll service for scrolling 122 | * based on the url anchor. 123 | */ 124 | useAnchorScroll(): void; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /bower_components/ui-router/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-ui-router", 3 | "version": "0.2.15", 4 | "main": "./release/angular-ui-router.js", 5 | "dependencies": { 6 | "angular": ">= 1.0.8" 7 | }, 8 | "ignore": [ 9 | "**/.*", 10 | "node_modules", 11 | "bower_components", 12 | "component.json", 13 | "package.json", 14 | "lib", 15 | "config", 16 | "sample", 17 | "test", 18 | "tests", 19 | "ngdoc_assets", 20 | "Gruntfile.js", 21 | "files.js" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/common.js: -------------------------------------------------------------------------------- 1 | /*jshint globalstrict:true*/ 2 | /*global angular:false*/ 3 | 'use strict'; 4 | 5 | var isDefined = angular.isDefined, 6 | isFunction = angular.isFunction, 7 | isString = angular.isString, 8 | isObject = angular.isObject, 9 | isArray = angular.isArray, 10 | forEach = angular.forEach, 11 | extend = angular.extend, 12 | copy = angular.copy; 13 | 14 | function inherit(parent, extra) { 15 | return extend(new (extend(function() {}, { prototype: parent }))(), extra); 16 | } 17 | 18 | function merge(dst) { 19 | forEach(arguments, function(obj) { 20 | if (obj !== dst) { 21 | forEach(obj, function(value, key) { 22 | if (!dst.hasOwnProperty(key)) dst[key] = value; 23 | }); 24 | } 25 | }); 26 | return dst; 27 | } 28 | 29 | /** 30 | * Finds the common ancestor path between two states. 31 | * 32 | * @param {Object} first The first state. 33 | * @param {Object} second The second state. 34 | * @return {Array} Returns an array of state names in descending order, not including the root. 35 | */ 36 | function ancestors(first, second) { 37 | var path = []; 38 | 39 | for (var n in first.path) { 40 | if (first.path[n] !== second.path[n]) break; 41 | path.push(first.path[n]); 42 | } 43 | return path; 44 | } 45 | 46 | /** 47 | * IE8-safe wrapper for `Object.keys()`. 48 | * 49 | * @param {Object} object A JavaScript object. 50 | * @return {Array} Returns the keys of the object as an array. 51 | */ 52 | function objectKeys(object) { 53 | if (Object.keys) { 54 | return Object.keys(object); 55 | } 56 | var result = []; 57 | 58 | forEach(object, function(val, key) { 59 | result.push(key); 60 | }); 61 | return result; 62 | } 63 | 64 | /** 65 | * IE8-safe wrapper for `Array.prototype.indexOf()`. 66 | * 67 | * @param {Array} array A JavaScript array. 68 | * @param {*} value A value to search the array for. 69 | * @return {Number} Returns the array index value of `value`, or `-1` if not present. 70 | */ 71 | function indexOf(array, value) { 72 | if (Array.prototype.indexOf) { 73 | return array.indexOf(value, Number(arguments[2]) || 0); 74 | } 75 | var len = array.length >>> 0, from = Number(arguments[2]) || 0; 76 | from = (from < 0) ? Math.ceil(from) : Math.floor(from); 77 | 78 | if (from < 0) from += len; 79 | 80 | for (; from < len; from++) { 81 | if (from in array && array[from] === value) return from; 82 | } 83 | return -1; 84 | } 85 | 86 | /** 87 | * Merges a set of parameters with all parameters inherited between the common parents of the 88 | * current state and a given destination state. 89 | * 90 | * @param {Object} currentParams The value of the current state parameters ($stateParams). 91 | * @param {Object} newParams The set of parameters which will be composited with inherited params. 92 | * @param {Object} $current Internal definition of object representing the current state. 93 | * @param {Object} $to Internal definition of object representing state to transition to. 94 | */ 95 | function inheritParams(currentParams, newParams, $current, $to) { 96 | var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = []; 97 | 98 | for (var i in parents) { 99 | if (!parents[i].params) continue; 100 | parentParams = objectKeys(parents[i].params); 101 | if (!parentParams.length) continue; 102 | 103 | for (var j in parentParams) { 104 | if (indexOf(inheritList, parentParams[j]) >= 0) continue; 105 | inheritList.push(parentParams[j]); 106 | inherited[parentParams[j]] = currentParams[parentParams[j]]; 107 | } 108 | } 109 | return extend({}, inherited, newParams); 110 | } 111 | 112 | /** 113 | * Performs a non-strict comparison of the subset of two objects, defined by a list of keys. 114 | * 115 | * @param {Object} a The first object. 116 | * @param {Object} b The second object. 117 | * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified, 118 | * it defaults to the list of keys in `a`. 119 | * @return {Boolean} Returns `true` if the keys match, otherwise `false`. 120 | */ 121 | function equalForKeys(a, b, keys) { 122 | if (!keys) { 123 | keys = []; 124 | for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility 125 | } 126 | 127 | for (var i=0; i 274 | * 275 | * 276 | * 277 | * 278 | * 279 | * 280 | * 284 | * 285 | * 286 | * 287 | * 288 | * 289 | */ 290 | angular.module('ui.router', ['ui.router.state']); 291 | 292 | angular.module('ui.router.compat', ['ui.router']); 293 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/resolve.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @ngdoc object 3 | * @name ui.router.util.$resolve 4 | * 5 | * @requires $q 6 | * @requires $injector 7 | * 8 | * @description 9 | * Manages resolution of (acyclic) graphs of promises. 10 | */ 11 | $Resolve.$inject = ['$q', '$injector']; 12 | function $Resolve( $q, $injector) { 13 | 14 | var VISIT_IN_PROGRESS = 1, 15 | VISIT_DONE = 2, 16 | NOTHING = {}, 17 | NO_DEPENDENCIES = [], 18 | NO_LOCALS = NOTHING, 19 | NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING }); 20 | 21 | 22 | /** 23 | * @ngdoc function 24 | * @name ui.router.util.$resolve#study 25 | * @methodOf ui.router.util.$resolve 26 | * 27 | * @description 28 | * Studies a set of invocables that are likely to be used multiple times. 29 | *
 30 |    * $resolve.study(invocables)(locals, parent, self)
 31 |    * 
32 | * is equivalent to 33 | *
 34 |    * $resolve.resolve(invocables, locals, parent, self)
 35 |    * 
36 | * but the former is more efficient (in fact `resolve` just calls `study` 37 | * internally). 38 | * 39 | * @param {object} invocables Invocable objects 40 | * @return {function} a function to pass in locals, parent and self 41 | */ 42 | this.study = function (invocables) { 43 | if (!isObject(invocables)) throw new Error("'invocables' must be an object"); 44 | var invocableKeys = objectKeys(invocables || {}); 45 | 46 | // Perform a topological sort of invocables to build an ordered plan 47 | var plan = [], cycle = [], visited = {}; 48 | function visit(value, key) { 49 | if (visited[key] === VISIT_DONE) return; 50 | 51 | cycle.push(key); 52 | if (visited[key] === VISIT_IN_PROGRESS) { 53 | cycle.splice(0, indexOf(cycle, key)); 54 | throw new Error("Cyclic dependency: " + cycle.join(" -> ")); 55 | } 56 | visited[key] = VISIT_IN_PROGRESS; 57 | 58 | if (isString(value)) { 59 | plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES); 60 | } else { 61 | var params = $injector.annotate(value); 62 | forEach(params, function (param) { 63 | if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param); 64 | }); 65 | plan.push(key, value, params); 66 | } 67 | 68 | cycle.pop(); 69 | visited[key] = VISIT_DONE; 70 | } 71 | forEach(invocables, visit); 72 | invocables = cycle = visited = null; // plan is all that's required 73 | 74 | function isResolve(value) { 75 | return isObject(value) && value.then && value.$$promises; 76 | } 77 | 78 | return function (locals, parent, self) { 79 | if (isResolve(locals) && self === undefined) { 80 | self = parent; parent = locals; locals = null; 81 | } 82 | if (!locals) locals = NO_LOCALS; 83 | else if (!isObject(locals)) { 84 | throw new Error("'locals' must be an object"); 85 | } 86 | if (!parent) parent = NO_PARENT; 87 | else if (!isResolve(parent)) { 88 | throw new Error("'parent' must be a promise returned by $resolve.resolve()"); 89 | } 90 | 91 | // To complete the overall resolution, we have to wait for the parent 92 | // promise and for the promise for each invokable in our plan. 93 | var resolution = $q.defer(), 94 | result = resolution.promise, 95 | promises = result.$$promises = {}, 96 | values = extend({}, locals), 97 | wait = 1 + plan.length/3, 98 | merged = false; 99 | 100 | function done() { 101 | // Merge parent values we haven't got yet and publish our own $$values 102 | if (!--wait) { 103 | if (!merged) merge(values, parent.$$values); 104 | result.$$values = values; 105 | result.$$promises = result.$$promises || true; // keep for isResolve() 106 | delete result.$$inheritedValues; 107 | resolution.resolve(values); 108 | } 109 | } 110 | 111 | function fail(reason) { 112 | result.$$failure = reason; 113 | resolution.reject(reason); 114 | } 115 | 116 | // Short-circuit if parent has already failed 117 | if (isDefined(parent.$$failure)) { 118 | fail(parent.$$failure); 119 | return result; 120 | } 121 | 122 | if (parent.$$inheritedValues) { 123 | merge(values, omit(parent.$$inheritedValues, invocableKeys)); 124 | } 125 | 126 | // Merge parent values if the parent has already resolved, or merge 127 | // parent promises and wait if the parent resolve is still in progress. 128 | extend(promises, parent.$$promises); 129 | if (parent.$$values) { 130 | merged = merge(values, omit(parent.$$values, invocableKeys)); 131 | result.$$inheritedValues = omit(parent.$$values, invocableKeys); 132 | done(); 133 | } else { 134 | if (parent.$$inheritedValues) { 135 | result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys); 136 | } 137 | parent.then(done, fail); 138 | } 139 | 140 | // Process each invocable in the plan, but ignore any where a local of the same name exists. 141 | for (var i=0, ii=plan.length; i` tag) to a state. If the state has an associated 28 | * URL, the directive will automatically generate & update the `href` attribute via 29 | * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking 30 | * the link will trigger a state transition with optional parameters. 31 | * 32 | * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be 33 | * handled natively by the browser. 34 | * 35 | * You can also use relative state paths within ui-sref, just like the relative 36 | * paths passed to `$state.go()`. You just need to be aware that the path is relative 37 | * to the state that the link lives in, in other words the state that loaded the 38 | * template containing the link. 39 | * 40 | * You can specify options to pass to {@link ui.router.state.$state#go $state.go()} 41 | * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`, 42 | * and `reload`. 43 | * 44 | * @example 45 | * Here's an example of how you'd use ui-sref and how it would compile. If you have the 46 | * following template: 47 | *
 48 |  * Home | About | Next page
 49 |  * 
 50 |  * 
 55 |  * 
56 | * 57 | * Then the compiled html would be (assuming Html5Mode is off and current state is contacts): 58 | *
 59 |  * Home | About | Next page
 60 |  * 
 61 |  * 
    62 | *
  • 63 | * Joe 64 | *
  • 65 | *
  • 66 | * Alice 67 | *
  • 68 | *
  • 69 | * Bob 70 | *
  • 71 | *
72 | * 73 | * Home 74 | *
75 | * 76 | * @param {string} ui-sref 'stateName' can be any valid absolute or relative state 77 | * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()} 78 | */ 79 | $StateRefDirective.$inject = ['$state', '$timeout']; 80 | function $StateRefDirective($state, $timeout) { 81 | var allowedOptions = ['location', 'inherit', 'reload', 'absolute']; 82 | 83 | return { 84 | restrict: 'A', 85 | require: ['?^uiSrefActive', '?^uiSrefActiveEq'], 86 | link: function(scope, element, attrs, uiSrefActive) { 87 | var ref = parseStateRef(attrs.uiSref, $state.current.name); 88 | var params = null, url = null, base = stateContext(element) || $state.$current; 89 | // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. 90 | var hrefKind = Object.prototype.toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? 91 | 'xlink:href' : 'href'; 92 | var newHref = null, isAnchor = element.prop("tagName").toUpperCase() === "A"; 93 | var isForm = element[0].nodeName === "FORM"; 94 | var attr = isForm ? "action" : hrefKind, nav = true; 95 | 96 | var options = { relative: base, inherit: true }; 97 | var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {}; 98 | 99 | angular.forEach(allowedOptions, function(option) { 100 | if (option in optionsOverride) { 101 | options[option] = optionsOverride[option]; 102 | } 103 | }); 104 | 105 | var update = function(newVal) { 106 | if (newVal) params = angular.copy(newVal); 107 | if (!nav) return; 108 | 109 | newHref = $state.href(ref.state, params, options); 110 | 111 | var activeDirective = uiSrefActive[1] || uiSrefActive[0]; 112 | if (activeDirective) { 113 | activeDirective.$$addStateInfo(ref.state, params); 114 | } 115 | if (newHref === null) { 116 | nav = false; 117 | return false; 118 | } 119 | attrs.$set(attr, newHref); 120 | }; 121 | 122 | if (ref.paramExpr) { 123 | scope.$watch(ref.paramExpr, function(newVal, oldVal) { 124 | if (newVal !== params) update(newVal); 125 | }, true); 126 | params = angular.copy(scope.$eval(ref.paramExpr)); 127 | } 128 | update(); 129 | 130 | if (isForm) return; 131 | 132 | element.bind("click", function(e) { 133 | var button = e.which || e.button; 134 | if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) { 135 | // HACK: This is to allow ng-clicks to be processed before the transition is initiated: 136 | var transition = $timeout(function() { 137 | $state.go(ref.state, params, options); 138 | }); 139 | e.preventDefault(); 140 | 141 | // if the state has no URL, ignore one preventDefault from the directive. 142 | var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0; 143 | e.preventDefault = function() { 144 | if (ignorePreventDefaultCount-- <= 0) 145 | $timeout.cancel(transition); 146 | }; 147 | } 148 | }); 149 | } 150 | }; 151 | } 152 | 153 | /** 154 | * @ngdoc directive 155 | * @name ui.router.state.directive:ui-sref-active 156 | * 157 | * @requires ui.router.state.$state 158 | * @requires ui.router.state.$stateParams 159 | * @requires $interpolate 160 | * 161 | * @restrict A 162 | * 163 | * @description 164 | * A directive working alongside ui-sref to add classes to an element when the 165 | * related ui-sref directive's state is active, and removing them when it is inactive. 166 | * The primary use-case is to simplify the special appearance of navigation menus 167 | * relying on `ui-sref`, by having the "active" state's menu button appear different, 168 | * distinguishing it from the inactive menu items. 169 | * 170 | * ui-sref-active can live on the same element as ui-sref or on a parent element. The first 171 | * ui-sref-active found at the same level or above the ui-sref will be used. 172 | * 173 | * Will activate when the ui-sref's target state or any child state is active. If you 174 | * need to activate only when the ui-sref target state is active and *not* any of 175 | * it's children, then you will use 176 | * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq} 177 | * 178 | * @example 179 | * Given the following template: 180 | *
181 |  * 
186 |  * 
187 | * 188 | * 189 | * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins", 190 | * the resulting HTML will appear as (note the 'active' class): 191 | *
192 |  * 
197 |  * 
198 | * 199 | * The class name is interpolated **once** during the directives link time (any further changes to the 200 | * interpolated value are ignored). 201 | * 202 | * Multiple classes may be specified in a space-separated format: 203 | *
204 |  * 
    205 | *
  • 206 | * link 207 | *
  • 208 | *
209 | *
210 | */ 211 | 212 | /** 213 | * @ngdoc directive 214 | * @name ui.router.state.directive:ui-sref-active-eq 215 | * 216 | * @requires ui.router.state.$state 217 | * @requires ui.router.state.$stateParams 218 | * @requires $interpolate 219 | * 220 | * @restrict A 221 | * 222 | * @description 223 | * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate 224 | * when the exact target state used in the `ui-sref` is active; no child states. 225 | * 226 | */ 227 | $StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate']; 228 | function $StateRefActiveDirective($state, $stateParams, $interpolate) { 229 | return { 230 | restrict: "A", 231 | controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { 232 | var states = [], activeClass; 233 | 234 | // There probably isn't much point in $observing this 235 | // uiSrefActive and uiSrefActiveEq share the same directive object with some 236 | // slight difference in logic routing 237 | activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope); 238 | 239 | // Allow uiSref to communicate with uiSrefActive[Equals] 240 | this.$$addStateInfo = function (newState, newParams) { 241 | var state = $state.get(newState, stateContext($element)); 242 | 243 | states.push({ 244 | state: state || { name: newState }, 245 | params: newParams 246 | }); 247 | 248 | update(); 249 | }; 250 | 251 | $scope.$on('$stateChangeSuccess', update); 252 | 253 | // Update route state 254 | function update() { 255 | if (anyMatch()) { 256 | $element.addClass(activeClass); 257 | } else { 258 | $element.removeClass(activeClass); 259 | } 260 | } 261 | 262 | function anyMatch() { 263 | for (var i = 0; i < states.length; i++) { 264 | if (isMatch(states[i].state, states[i].params)) { 265 | return true; 266 | } 267 | } 268 | return false; 269 | } 270 | 271 | function isMatch(state, params) { 272 | if (typeof $attrs.uiSrefActiveEq !== 'undefined') { 273 | return $state.is(state.name, params); 274 | } else { 275 | return $state.includes(state.name, params); 276 | } 277 | } 278 | }] 279 | }; 280 | } 281 | 282 | angular.module('ui.router.state') 283 | .directive('uiSref', $StateRefDirective) 284 | .directive('uiSrefActive', $StateRefActiveDirective) 285 | .directive('uiSrefActiveEq', $StateRefActiveDirective); 286 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/stateFilters.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @ngdoc filter 3 | * @name ui.router.state.filter:isState 4 | * 5 | * @requires ui.router.state.$state 6 | * 7 | * @description 8 | * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}. 9 | */ 10 | $IsStateFilter.$inject = ['$state']; 11 | function $IsStateFilter($state) { 12 | var isFilter = function (state) { 13 | return $state.is(state); 14 | }; 15 | isFilter.$stateful = true; 16 | return isFilter; 17 | } 18 | 19 | /** 20 | * @ngdoc filter 21 | * @name ui.router.state.filter:includedByState 22 | * 23 | * @requires ui.router.state.$state 24 | * 25 | * @description 26 | * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}. 27 | */ 28 | $IncludedByStateFilter.$inject = ['$state']; 29 | function $IncludedByStateFilter($state) { 30 | var includesFilter = function (state) { 31 | return $state.includes(state); 32 | }; 33 | includesFilter.$stateful = true; 34 | return includesFilter; 35 | } 36 | 37 | angular.module('ui.router.state') 38 | .filter('isState', $IsStateFilter) 39 | .filter('includedByState', $IncludedByStateFilter); 40 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/templateFactory.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @ngdoc object 3 | * @name ui.router.util.$templateFactory 4 | * 5 | * @requires $http 6 | * @requires $templateCache 7 | * @requires $injector 8 | * 9 | * @description 10 | * Service. Manages loading of templates. 11 | */ 12 | $TemplateFactory.$inject = ['$http', '$templateCache', '$injector']; 13 | function $TemplateFactory( $http, $templateCache, $injector) { 14 | 15 | /** 16 | * @ngdoc function 17 | * @name ui.router.util.$templateFactory#fromConfig 18 | * @methodOf ui.router.util.$templateFactory 19 | * 20 | * @description 21 | * Creates a template from a configuration object. 22 | * 23 | * @param {object} config Configuration object for which to load a template. 24 | * The following properties are search in the specified order, and the first one 25 | * that is defined is used to create the template: 26 | * 27 | * @param {string|object} config.template html string template or function to 28 | * load via {@link ui.router.util.$templateFactory#fromString fromString}. 29 | * @param {string|object} config.templateUrl url to load or a function returning 30 | * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}. 31 | * @param {Function} config.templateProvider function to invoke via 32 | * {@link ui.router.util.$templateFactory#fromProvider fromProvider}. 33 | * @param {object} params Parameters to pass to the template function. 34 | * @param {object} locals Locals to pass to `invoke` if the template is loaded 35 | * via a `templateProvider`. Defaults to `{ params: params }`. 36 | * 37 | * @return {string|object} The template html as a string, or a promise for 38 | * that string,or `null` if no template is configured. 39 | */ 40 | this.fromConfig = function (config, params, locals) { 41 | return ( 42 | isDefined(config.template) ? this.fromString(config.template, params) : 43 | isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) : 44 | isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) : 45 | null 46 | ); 47 | }; 48 | 49 | /** 50 | * @ngdoc function 51 | * @name ui.router.util.$templateFactory#fromString 52 | * @methodOf ui.router.util.$templateFactory 53 | * 54 | * @description 55 | * Creates a template from a string or a function returning a string. 56 | * 57 | * @param {string|object} template html template as a string or function that 58 | * returns an html template as a string. 59 | * @param {object} params Parameters to pass to the template function. 60 | * 61 | * @return {string|object} The template html as a string, or a promise for that 62 | * string. 63 | */ 64 | this.fromString = function (template, params) { 65 | return isFunction(template) ? template(params) : template; 66 | }; 67 | 68 | /** 69 | * @ngdoc function 70 | * @name ui.router.util.$templateFactory#fromUrl 71 | * @methodOf ui.router.util.$templateFactory 72 | * 73 | * @description 74 | * Loads a template from the a URL via `$http` and `$templateCache`. 75 | * 76 | * @param {string|Function} url url of the template to load, or a function 77 | * that returns a url. 78 | * @param {Object} params Parameters to pass to the url function. 79 | * @return {string|Promise.} The template html as a string, or a promise 80 | * for that string. 81 | */ 82 | this.fromUrl = function (url, params) { 83 | if (isFunction(url)) url = url(params); 84 | if (url == null) return null; 85 | else return $http 86 | .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }}) 87 | .then(function(response) { return response.data; }); 88 | }; 89 | 90 | /** 91 | * @ngdoc function 92 | * @name ui.router.util.$templateFactory#fromProvider 93 | * @methodOf ui.router.util.$templateFactory 94 | * 95 | * @description 96 | * Creates a template by invoking an injectable provider function. 97 | * 98 | * @param {Function} provider Function to invoke via `$injector.invoke` 99 | * @param {Object} params Parameters for the template. 100 | * @param {Object} locals Locals to pass to `invoke`. Defaults to 101 | * `{ params: params }`. 102 | * @return {string|Promise.} The template html as a string, or a promise 103 | * for that string. 104 | */ 105 | this.fromProvider = function (provider, params, locals) { 106 | return $injector.invoke(provider, null, locals || { params: params }); 107 | }; 108 | } 109 | 110 | angular.module('ui.router.util').service('$templateFactory', $TemplateFactory); 111 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/urlRouter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @ngdoc object 3 | * @name ui.router.router.$urlRouterProvider 4 | * 5 | * @requires ui.router.util.$urlMatcherFactoryProvider 6 | * @requires $locationProvider 7 | * 8 | * @description 9 | * `$urlRouterProvider` has the responsibility of watching `$location`. 10 | * When `$location` changes it runs through a list of rules one by one until a 11 | * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify 12 | * a url in a state configuration. All urls are compiled into a UrlMatcher object. 13 | * 14 | * There are several methods on `$urlRouterProvider` that make it useful to use directly 15 | * in your module config. 16 | */ 17 | $UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider']; 18 | function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { 19 | var rules = [], otherwise = null, interceptDeferred = false, listener; 20 | 21 | // Returns a string that is a prefix of all strings matching the RegExp 22 | function regExpPrefix(re) { 23 | var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source); 24 | return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : ''; 25 | } 26 | 27 | // Interpolates matched values into a String.replace()-style pattern 28 | function interpolate(pattern, match) { 29 | return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) { 30 | return match[what === '$' ? 0 : Number(what)]; 31 | }); 32 | } 33 | 34 | /** 35 | * @ngdoc function 36 | * @name ui.router.router.$urlRouterProvider#rule 37 | * @methodOf ui.router.router.$urlRouterProvider 38 | * 39 | * @description 40 | * Defines rules that are used by `$urlRouterProvider` to find matches for 41 | * specific URLs. 42 | * 43 | * @example 44 | *
 45 |    * var app = angular.module('app', ['ui.router.router']);
 46 |    *
 47 |    * app.config(function ($urlRouterProvider) {
 48 |    *   // Here's an example of how you might allow case insensitive urls
 49 |    *   $urlRouterProvider.rule(function ($injector, $location) {
 50 |    *     var path = $location.path(),
 51 |    *         normalized = path.toLowerCase();
 52 |    *
 53 |    *     if (path !== normalized) {
 54 |    *       return normalized;
 55 |    *     }
 56 |    *   });
 57 |    * });
 58 |    * 
59 | * 60 | * @param {object} rule Handler function that takes `$injector` and `$location` 61 | * services as arguments. You can use them to return a valid path as a string. 62 | * 63 | * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance 64 | */ 65 | this.rule = function (rule) { 66 | if (!isFunction(rule)) throw new Error("'rule' must be a function"); 67 | rules.push(rule); 68 | return this; 69 | }; 70 | 71 | /** 72 | * @ngdoc object 73 | * @name ui.router.router.$urlRouterProvider#otherwise 74 | * @methodOf ui.router.router.$urlRouterProvider 75 | * 76 | * @description 77 | * Defines a path that is used when an invalid route is requested. 78 | * 79 | * @example 80 | *
 81 |    * var app = angular.module('app', ['ui.router.router']);
 82 |    *
 83 |    * app.config(function ($urlRouterProvider) {
 84 |    *   // if the path doesn't match any of the urls you configured
 85 |    *   // otherwise will take care of routing the user to the
 86 |    *   // specified url
 87 |    *   $urlRouterProvider.otherwise('/index');
 88 |    *
 89 |    *   // Example of using function rule as param
 90 |    *   $urlRouterProvider.otherwise(function ($injector, $location) {
 91 |    *     return '/a/valid/url';
 92 |    *   });
 93 |    * });
 94 |    * 
95 | * 96 | * @param {string|object} rule The url path you want to redirect to or a function 97 | * rule that returns the url path. The function version is passed two params: 98 | * `$injector` and `$location` services, and must return a url string. 99 | * 100 | * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance 101 | */ 102 | this.otherwise = function (rule) { 103 | if (isString(rule)) { 104 | var redirect = rule; 105 | rule = function () { return redirect; }; 106 | } 107 | else if (!isFunction(rule)) throw new Error("'rule' must be a function"); 108 | otherwise = rule; 109 | return this; 110 | }; 111 | 112 | 113 | function handleIfMatch($injector, handler, match) { 114 | if (!match) return false; 115 | var result = $injector.invoke(handler, handler, { $match: match }); 116 | return isDefined(result) ? result : true; 117 | } 118 | 119 | /** 120 | * @ngdoc function 121 | * @name ui.router.router.$urlRouterProvider#when 122 | * @methodOf ui.router.router.$urlRouterProvider 123 | * 124 | * @description 125 | * Registers a handler for a given url matching. if handle is a string, it is 126 | * treated as a redirect, and is interpolated according to the syntax of match 127 | * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). 128 | * 129 | * If the handler is a function, it is injectable. It gets invoked if `$location` 130 | * matches. You have the option of inject the match object as `$match`. 131 | * 132 | * The handler can return 133 | * 134 | * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` 135 | * will continue trying to find another one that matches. 136 | * - **string** which is treated as a redirect and passed to `$location.url()` 137 | * - **void** or any **truthy** value tells `$urlRouter` that the url was handled. 138 | * 139 | * @example 140 | *
141 |    * var app = angular.module('app', ['ui.router.router']);
142 |    *
143 |    * app.config(function ($urlRouterProvider) {
144 |    *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
145 |    *     if ($state.$current.navigable !== state ||
146 |    *         !equalForKeys($match, $stateParams) {
147 |    *      $state.transitionTo(state, $match, false);
148 |    *     }
149 |    *   });
150 |    * });
151 |    * 
152 | * 153 | * @param {string|object} what The incoming path that you want to redirect. 154 | * @param {string|object} handler The path you want to redirect your user to. 155 | */ 156 | this.when = function (what, handler) { 157 | var redirect, handlerIsString = isString(handler); 158 | if (isString(what)) what = $urlMatcherFactory.compile(what); 159 | 160 | if (!handlerIsString && !isFunction(handler) && !isArray(handler)) 161 | throw new Error("invalid 'handler' in when()"); 162 | 163 | var strategies = { 164 | matcher: function (what, handler) { 165 | if (handlerIsString) { 166 | redirect = $urlMatcherFactory.compile(handler); 167 | handler = ['$match', function ($match) { return redirect.format($match); }]; 168 | } 169 | return extend(function ($injector, $location) { 170 | return handleIfMatch($injector, handler, what.exec($location.path(), $location.search())); 171 | }, { 172 | prefix: isString(what.prefix) ? what.prefix : '' 173 | }); 174 | }, 175 | regex: function (what, handler) { 176 | if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky"); 177 | 178 | if (handlerIsString) { 179 | redirect = handler; 180 | handler = ['$match', function ($match) { return interpolate(redirect, $match); }]; 181 | } 182 | return extend(function ($injector, $location) { 183 | return handleIfMatch($injector, handler, what.exec($location.path())); 184 | }, { 185 | prefix: regExpPrefix(what) 186 | }); 187 | } 188 | }; 189 | 190 | var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp }; 191 | 192 | for (var n in check) { 193 | if (check[n]) return this.rule(strategies[n](what, handler)); 194 | } 195 | 196 | throw new Error("invalid 'what' in when()"); 197 | }; 198 | 199 | /** 200 | * @ngdoc function 201 | * @name ui.router.router.$urlRouterProvider#deferIntercept 202 | * @methodOf ui.router.router.$urlRouterProvider 203 | * 204 | * @description 205 | * Disables (or enables) deferring location change interception. 206 | * 207 | * If you wish to customize the behavior of syncing the URL (for example, if you wish to 208 | * defer a transition but maintain the current URL), call this method at configuration time. 209 | * Then, at run time, call `$urlRouter.listen()` after you have configured your own 210 | * `$locationChangeSuccess` event handler. 211 | * 212 | * @example 213 | *
214 |    * var app = angular.module('app', ['ui.router.router']);
215 |    *
216 |    * app.config(function ($urlRouterProvider) {
217 |    *
218 |    *   // Prevent $urlRouter from automatically intercepting URL changes;
219 |    *   // this allows you to configure custom behavior in between
220 |    *   // location changes and route synchronization:
221 |    *   $urlRouterProvider.deferIntercept();
222 |    *
223 |    * }).run(function ($rootScope, $urlRouter, UserService) {
224 |    *
225 |    *   $rootScope.$on('$locationChangeSuccess', function(e) {
226 |    *     // UserService is an example service for managing user state
227 |    *     if (UserService.isLoggedIn()) return;
228 |    *
229 |    *     // Prevent $urlRouter's default handler from firing
230 |    *     e.preventDefault();
231 |    *
232 |    *     UserService.handleLogin().then(function() {
233 |    *       // Once the user has logged in, sync the current URL
234 |    *       // to the router:
235 |    *       $urlRouter.sync();
236 |    *     });
237 |    *   });
238 |    *
239 |    *   // Configures $urlRouter's listener *after* your custom listener
240 |    *   $urlRouter.listen();
241 |    * });
242 |    * 
243 | * 244 | * @param {boolean} defer Indicates whether to defer location change interception. Passing 245 | no parameter is equivalent to `true`. 246 | */ 247 | this.deferIntercept = function (defer) { 248 | if (defer === undefined) defer = true; 249 | interceptDeferred = defer; 250 | }; 251 | 252 | /** 253 | * @ngdoc object 254 | * @name ui.router.router.$urlRouter 255 | * 256 | * @requires $location 257 | * @requires $rootScope 258 | * @requires $injector 259 | * @requires $browser 260 | * 261 | * @description 262 | * 263 | */ 264 | this.$get = $get; 265 | $get.$inject = ['$location', '$rootScope', '$injector', '$browser']; 266 | function $get( $location, $rootScope, $injector, $browser) { 267 | 268 | var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl; 269 | 270 | function appendBasePath(url, isHtml5, absolute) { 271 | if (baseHref === '/') return url; 272 | if (isHtml5) return baseHref.slice(0, -1) + url; 273 | if (absolute) return baseHref.slice(1) + url; 274 | return url; 275 | } 276 | 277 | // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree 278 | function update(evt) { 279 | if (evt && evt.defaultPrevented) return; 280 | var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl; 281 | lastPushedUrl = undefined; 282 | // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573 283 | //if (ignoreUpdate) return true; 284 | 285 | function check(rule) { 286 | var handled = rule($injector, $location); 287 | 288 | if (!handled) return false; 289 | if (isString(handled)) $location.replace().url(handled); 290 | return true; 291 | } 292 | var n = rules.length, i; 293 | 294 | for (i = 0; i < n; i++) { 295 | if (check(rules[i])) return; 296 | } 297 | // always check otherwise last to allow dynamic updates to the set of rules 298 | if (otherwise) check(otherwise); 299 | } 300 | 301 | function listen() { 302 | listener = listener || $rootScope.$on('$locationChangeSuccess', update); 303 | return listener; 304 | } 305 | 306 | if (!interceptDeferred) listen(); 307 | 308 | return { 309 | /** 310 | * @ngdoc function 311 | * @name ui.router.router.$urlRouter#sync 312 | * @methodOf ui.router.router.$urlRouter 313 | * 314 | * @description 315 | * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`. 316 | * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event, 317 | * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed 318 | * with the transition by calling `$urlRouter.sync()`. 319 | * 320 | * @example 321 | *
322 |        * angular.module('app', ['ui.router'])
323 |        *   .run(function($rootScope, $urlRouter) {
324 |        *     $rootScope.$on('$locationChangeSuccess', function(evt) {
325 |        *       // Halt state change from even starting
326 |        *       evt.preventDefault();
327 |        *       // Perform custom logic
328 |        *       var meetsRequirement = ...
329 |        *       // Continue with the update and state transition if logic allows
330 |        *       if (meetsRequirement) $urlRouter.sync();
331 |        *     });
332 |        * });
333 |        * 
334 | */ 335 | sync: function() { 336 | update(); 337 | }, 338 | 339 | listen: function() { 340 | return listen(); 341 | }, 342 | 343 | update: function(read) { 344 | if (read) { 345 | location = $location.url(); 346 | return; 347 | } 348 | if ($location.url() === location) return; 349 | 350 | $location.url(location); 351 | $location.replace(); 352 | }, 353 | 354 | push: function(urlMatcher, params, options) { 355 | var url = urlMatcher.format(params || {}); 356 | 357 | // Handle the special hash param, if needed 358 | if (url !== null && params && params['#']) { 359 | url += '#' + params['#']; 360 | } 361 | 362 | $location.url(url); 363 | lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined; 364 | if (options && options.replace) $location.replace(); 365 | }, 366 | 367 | /** 368 | * @ngdoc function 369 | * @name ui.router.router.$urlRouter#href 370 | * @methodOf ui.router.router.$urlRouter 371 | * 372 | * @description 373 | * A URL generation method that returns the compiled URL for a given 374 | * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters. 375 | * 376 | * @example 377 | *
378 |        * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
379 |        *   person: "bob"
380 |        * });
381 |        * // $bob == "/about/bob";
382 |        * 
383 | * 384 | * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate. 385 | * @param {object=} params An object of parameter values to fill the matcher's required parameters. 386 | * @param {object=} options Options object. The options are: 387 | * 388 | * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". 389 | * 390 | * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher` 391 | */ 392 | href: function(urlMatcher, params, options) { 393 | if (!urlMatcher.validates(params)) return null; 394 | 395 | var isHtml5 = $locationProvider.html5Mode(); 396 | if (angular.isObject(isHtml5)) { 397 | isHtml5 = isHtml5.enabled; 398 | } 399 | 400 | var url = urlMatcher.format(params); 401 | options = options || {}; 402 | 403 | if (!isHtml5 && url !== null) { 404 | url = "#" + $locationProvider.hashPrefix() + url; 405 | } 406 | 407 | // Handle special hash param, if needed 408 | if (url !== null && params && params['#']) { 409 | url += '#' + params['#']; 410 | } 411 | 412 | url = appendBasePath(url, isHtml5, options.absolute); 413 | 414 | if (!options.absolute || !url) { 415 | return url; 416 | } 417 | 418 | var slash = (!isHtml5 && url ? '/' : ''), port = $location.port(); 419 | port = (port === 80 || port === 443 ? '' : ':' + port); 420 | 421 | return [$location.protocol(), '://', $location.host(), port, slash, url].join(''); 422 | } 423 | }; 424 | } 425 | } 426 | 427 | angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider); 428 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/view.js: -------------------------------------------------------------------------------- 1 | 2 | $ViewProvider.$inject = []; 3 | function $ViewProvider() { 4 | 5 | this.$get = $get; 6 | /** 7 | * @ngdoc object 8 | * @name ui.router.state.$view 9 | * 10 | * @requires ui.router.util.$templateFactory 11 | * @requires $rootScope 12 | * 13 | * @description 14 | * 15 | */ 16 | $get.$inject = ['$rootScope', '$templateFactory']; 17 | function $get( $rootScope, $templateFactory) { 18 | return { 19 | // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... }) 20 | /** 21 | * @ngdoc function 22 | * @name ui.router.state.$view#load 23 | * @methodOf ui.router.state.$view 24 | * 25 | * @description 26 | * 27 | * @param {string} name name 28 | * @param {object} options option object. 29 | */ 30 | load: function load(name, options) { 31 | var result, defaults = { 32 | template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {} 33 | }; 34 | options = extend(defaults, options); 35 | 36 | if (options.view) { 37 | result = $templateFactory.fromConfig(options.view, options.params, options.locals); 38 | } 39 | if (result && options.notify) { 40 | /** 41 | * @ngdoc event 42 | * @name ui.router.state.$state#$viewContentLoading 43 | * @eventOf ui.router.state.$view 44 | * @eventType broadcast on root scope 45 | * @description 46 | * 47 | * Fired once the view **begins loading**, *before* the DOM is rendered. 48 | * 49 | * @param {Object} event Event object. 50 | * @param {Object} viewConfig The view config properties (template, controller, etc). 51 | * 52 | * @example 53 | * 54 | *
55 |          * $scope.$on('$viewContentLoading',
56 |          * function(event, viewConfig){
57 |          *     // Access to all the view config properties.
58 |          *     // and one special property 'targetView'
59 |          *     // viewConfig.targetView
60 |          * });
61 |          * 
62 | */ 63 | $rootScope.$broadcast('$viewContentLoading', options); 64 | } 65 | return result; 66 | } 67 | }; 68 | } 69 | } 70 | 71 | angular.module('ui.router.state').provider('$view', $ViewProvider); 72 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/viewDirective.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @ngdoc directive 3 | * @name ui.router.state.directive:ui-view 4 | * 5 | * @requires ui.router.state.$state 6 | * @requires $compile 7 | * @requires $controller 8 | * @requires $injector 9 | * @requires ui.router.state.$uiViewScroll 10 | * @requires $document 11 | * 12 | * @restrict ECA 13 | * 14 | * @description 15 | * The ui-view directive tells $state where to place your templates. 16 | * 17 | * @param {string=} name A view name. The name should be unique amongst the other views in the 18 | * same state. You can have views of the same name that live in different states. 19 | * 20 | * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window 21 | * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll 22 | * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you 23 | * scroll ui-view elements into view when they are populated during a state activation. 24 | * 25 | * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) 26 | * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.* 27 | * 28 | * @param {string=} onload Expression to evaluate whenever the view updates. 29 | * 30 | * @example 31 | * A view can be unnamed or named. 32 | *
 33 |  * 
 34 |  * 
35 | * 36 | * 37 | *
38 | *
39 | * 40 | * You can only have one unnamed view within any template (or root html). If you are only using a 41 | * single view and it is unnamed then you can populate it like so: 42 | *
 43 |  * 
44 | * $stateProvider.state("home", { 45 | * template: "

HELLO!

" 46 | * }) 47 | *
48 | * 49 | * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`} 50 | * config property, by name, in this case an empty name: 51 | *
 52 |  * $stateProvider.state("home", {
 53 |  *   views: {
 54 |  *     "": {
 55 |  *       template: "

HELLO!

" 56 | * } 57 | * } 58 | * }) 59 | *
60 | * 61 | * But typically you'll only use the views property if you name your view or have more than one view 62 | * in the same template. There's not really a compelling reason to name a view if its the only one, 63 | * but you could if you wanted, like so: 64 | *
 65 |  * 
66 | *
67 | *
 68 |  * $stateProvider.state("home", {
 69 |  *   views: {
 70 |  *     "main": {
 71 |  *       template: "

HELLO!

" 72 | * } 73 | * } 74 | * }) 75 | *
76 | * 77 | * Really though, you'll use views to set up multiple views: 78 | *
 79 |  * 
80 | *
81 | *
82 | *
83 | * 84 | *
 85 |  * $stateProvider.state("home", {
 86 |  *   views: {
 87 |  *     "": {
 88 |  *       template: "

HELLO!

" 89 | * }, 90 | * "chart": { 91 | * template: "" 92 | * }, 93 | * "data": { 94 | * template: "" 95 | * } 96 | * } 97 | * }) 98 | *
99 | * 100 | * Examples for `autoscroll`: 101 | * 102 | *
103 |  * 
105 |  * 
106 |  *
107 |  * 
109 |  * 
110 |  * 
111 |  * 
112 |  * 
113 | */ 114 | $ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate']; 115 | function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate) { 116 | 117 | function getService() { 118 | return ($injector.has) ? function(service) { 119 | return $injector.has(service) ? $injector.get(service) : null; 120 | } : function(service) { 121 | try { 122 | return $injector.get(service); 123 | } catch (e) { 124 | return null; 125 | } 126 | }; 127 | } 128 | 129 | var service = getService(), 130 | $animator = service('$animator'), 131 | $animate = service('$animate'); 132 | 133 | // Returns a set of DOM manipulation functions based on which Angular version 134 | // it should use 135 | function getRenderer(attrs, scope) { 136 | var statics = function() { 137 | return { 138 | enter: function (element, target, cb) { target.after(element); cb(); }, 139 | leave: function (element, cb) { element.remove(); cb(); } 140 | }; 141 | }; 142 | 143 | if ($animate) { 144 | return { 145 | enter: function(element, target, cb) { 146 | var promise = $animate.enter(element, null, target, cb); 147 | if (promise && promise.then) promise.then(cb); 148 | }, 149 | leave: function(element, cb) { 150 | var promise = $animate.leave(element, cb); 151 | if (promise && promise.then) promise.then(cb); 152 | } 153 | }; 154 | } 155 | 156 | if ($animator) { 157 | var animate = $animator && $animator(scope, attrs); 158 | 159 | return { 160 | enter: function(element, target, cb) {animate.enter(element, null, target); cb(); }, 161 | leave: function(element, cb) { animate.leave(element); cb(); } 162 | }; 163 | } 164 | 165 | return statics(); 166 | } 167 | 168 | var directive = { 169 | restrict: 'ECA', 170 | terminal: true, 171 | priority: 400, 172 | transclude: 'element', 173 | compile: function (tElement, tAttrs, $transclude) { 174 | return function (scope, $element, attrs) { 175 | var previousEl, currentEl, currentScope, latestLocals, 176 | onloadExp = attrs.onload || '', 177 | autoScrollExp = attrs.autoscroll, 178 | renderer = getRenderer(attrs, scope); 179 | 180 | scope.$on('$stateChangeSuccess', function() { 181 | updateView(false); 182 | }); 183 | scope.$on('$viewContentLoading', function() { 184 | updateView(false); 185 | }); 186 | 187 | updateView(true); 188 | 189 | function cleanupLastView() { 190 | if (previousEl) { 191 | previousEl.remove(); 192 | previousEl = null; 193 | } 194 | 195 | if (currentScope) { 196 | currentScope.$destroy(); 197 | currentScope = null; 198 | } 199 | 200 | if (currentEl) { 201 | renderer.leave(currentEl, function() { 202 | previousEl = null; 203 | }); 204 | 205 | previousEl = currentEl; 206 | currentEl = null; 207 | } 208 | } 209 | 210 | function updateView(firstTime) { 211 | var newScope, 212 | name = getUiViewName(scope, attrs, $element, $interpolate), 213 | previousLocals = name && $state.$current && $state.$current.locals[name]; 214 | 215 | if (!firstTime && previousLocals === latestLocals) return; // nothing to do 216 | newScope = scope.$new(); 217 | latestLocals = $state.$current.locals[name]; 218 | 219 | var clone = $transclude(newScope, function(clone) { 220 | renderer.enter(clone, $element, function onUiViewEnter() { 221 | if(currentScope) { 222 | currentScope.$emit('$viewContentAnimationEnded'); 223 | } 224 | 225 | if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) { 226 | $uiViewScroll(clone); 227 | } 228 | }); 229 | cleanupLastView(); 230 | }); 231 | 232 | currentEl = clone; 233 | currentScope = newScope; 234 | /** 235 | * @ngdoc event 236 | * @name ui.router.state.directive:ui-view#$viewContentLoaded 237 | * @eventOf ui.router.state.directive:ui-view 238 | * @eventType emits on ui-view directive scope 239 | * @description * 240 | * Fired once the view is **loaded**, *after* the DOM is rendered. 241 | * 242 | * @param {Object} event Event object. 243 | */ 244 | currentScope.$emit('$viewContentLoaded'); 245 | currentScope.$eval(onloadExp); 246 | } 247 | }; 248 | } 249 | }; 250 | 251 | return directive; 252 | } 253 | 254 | $ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate']; 255 | function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) { 256 | return { 257 | restrict: 'ECA', 258 | priority: -400, 259 | compile: function (tElement) { 260 | var initial = tElement.html(); 261 | return function (scope, $element, attrs) { 262 | var current = $state.$current, 263 | name = getUiViewName(scope, attrs, $element, $interpolate), 264 | locals = current && current.locals[name]; 265 | 266 | if (! locals) { 267 | return; 268 | } 269 | 270 | $element.data('$uiView', { name: name, state: locals.$$state }); 271 | $element.html(locals.$template ? locals.$template : initial); 272 | 273 | var link = $compile($element.contents()); 274 | 275 | if (locals.$$controller) { 276 | locals.$scope = scope; 277 | locals.$element = $element; 278 | var controller = $controller(locals.$$controller, locals); 279 | if (locals.$$controllerAs) { 280 | scope[locals.$$controllerAs] = controller; 281 | } 282 | $element.data('$ngControllerController', controller); 283 | $element.children().data('$ngControllerController', controller); 284 | } 285 | 286 | link(scope); 287 | }; 288 | } 289 | }; 290 | } 291 | 292 | /** 293 | * Shared ui-view code for both directives: 294 | * Given scope, element, and its attributes, return the view's name 295 | */ 296 | function getUiViewName(scope, attrs, element, $interpolate) { 297 | var name = $interpolate(attrs.uiView || attrs.name || '')(scope); 298 | var inherited = element.inheritedData('$uiView'); 299 | return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : '')); 300 | } 301 | 302 | angular.module('ui.router.state').directive('uiView', $ViewDirective); 303 | angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill); 304 | -------------------------------------------------------------------------------- /bower_components/ui-router/src/viewScroll.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @ngdoc object 3 | * @name ui.router.state.$uiViewScrollProvider 4 | * 5 | * @description 6 | * Provider that returns the {@link ui.router.state.$uiViewScroll} service function. 7 | */ 8 | function $ViewScrollProvider() { 9 | 10 | var useAnchorScroll = false; 11 | 12 | /** 13 | * @ngdoc function 14 | * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll 15 | * @methodOf ui.router.state.$uiViewScrollProvider 16 | * 17 | * @description 18 | * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for 19 | * scrolling based on the url anchor. 20 | */ 21 | this.useAnchorScroll = function () { 22 | useAnchorScroll = true; 23 | }; 24 | 25 | /** 26 | * @ngdoc object 27 | * @name ui.router.state.$uiViewScroll 28 | * 29 | * @requires $anchorScroll 30 | * @requires $timeout 31 | * 32 | * @description 33 | * When called with a jqLite element, it scrolls the element into view (after a 34 | * `$timeout` so the DOM has time to refresh). 35 | * 36 | * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor, 37 | * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}. 38 | */ 39 | this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) { 40 | if (useAnchorScroll) { 41 | return $anchorScroll; 42 | } 43 | 44 | return function ($element) { 45 | return $timeout(function () { 46 | $element[0].scrollIntoView(); 47 | }, 0, false); 48 | }; 49 | }]; 50 | } 51 | 52 | angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider); 53 | -------------------------------------------------------------------------------- /home.html: -------------------------------------------------------------------------------- 1 |

Home

-------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | Lazy Module1 16 |
17 | 18 |
19 | Lazy Module2 20 |
21 | 22 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | require(['application'], function (app) { 2 | app.bootstrap(); 3 | }); -------------------------------------------------------------------------------- /module1/controller1.js: -------------------------------------------------------------------------------- 1 | angular.module('module1').controller('module1Controller',['service1',function(service1){ 2 | this.message = service1.getMessage(); 3 | }]); -------------------------------------------------------------------------------- /module1/module.js: -------------------------------------------------------------------------------- 1 | angular.module('module1',[]); 2 | 3 | angular.module('module1').controller('module1Controller',['service1',function(service1){ 4 | this.message = service1.getMessage(); 5 | }]); 6 | 7 | angular.module('module1').factory('service1', function(){ 8 | return{getMessage:function(){return 'Hello from lazy loaded service';}}; 9 | }); -------------------------------------------------------------------------------- /module1/module1.html: -------------------------------------------------------------------------------- 1 |
2 | {{module1Controller.message}} 3 |
-------------------------------------------------------------------------------- /module1/service1.js: -------------------------------------------------------------------------------- 1 | angular.module('module1').factory('service1', function(){ 2 | return{getMessage:function(){return 'Hello from lazy loaded service';}}; 3 | }); -------------------------------------------------------------------------------- /module2/directive2.js: -------------------------------------------------------------------------------- 1 | angular.module('module2').directive('greeting', function(){ 2 | 3 | return { 4 | template:'
{{message}}
', 5 | 6 | link:function($scope){ 7 | $scope.message = 'hello from a directive'; 8 | }}; 9 | }); -------------------------------------------------------------------------------- /module2/module.js: -------------------------------------------------------------------------------- 1 | angular.module('module2',[]); 2 | 3 | angular.module('module2').controller('module2Controller',function(){ 4 | this.message = 'Hello from a lazy loaded controller'; 5 | }); 6 | 7 | angular.module('module2').directive('greeting', function(){ 8 | 9 | return { 10 | template:'
{{message}}
', 11 | 12 | link:function($scope){ 13 | $scope.message = 'hello from a directive'; 14 | }}; 15 | }); -------------------------------------------------------------------------------- /module2/module2.html: -------------------------------------------------------------------------------- 1 |
2 | {{module2Controller.message}} 3 |
4 | 5 |
6 | 7 |
--------------------------------------------------------------------------------