├── README.md └── angularjs ├── list.html ├── server └── user.json ├── detail.html ├── index.html ├── demo_exp.html ├── demo_dsl.html ├── demo_index.html ├── demo_curd.html ├── js ├── controller.js ├── angular-route.min.js ├── angular-route.js └── angular.min.js └── demo_form.html /README.md: -------------------------------------------------------------------------------- 1 | angularjs 2 | ========= 3 | 4 | angularjs demo 5 | -------------------------------------------------------------------------------- /angularjs/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 |
用户名性别邮箱操作
{{user.username}}{{user.gender}}{{user.email}} 13 | 修改 14 | 删除 15 |
-------------------------------------------------------------------------------- /angularjs/server/user.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "id": 1, "username": "situ", "gender": "男", "email": "gao_st@126.com" }, 3 | { "id": 2, "username": "wb", "gender": "女", "email": "wb@126.com" }, 4 | { "id": 3, "username": "lml", "gender": "男", "email": "lml@126.com" }, 5 | { "id": 4, "username": "wjd", "gender": "女", "email": "wjd@126.com" }, 6 | { "id": 5, "username": "lyl", "gender": "男", "email": "lyl@126.com" }, 7 | { "id": 6, "username": "wjh", "gender": "女", "email": "wjh@126.com" } 8 | ] -------------------------------------------------------------------------------- /angularjs/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 |
用户名
邮箱
17 | 18 | 19 |
-------------------------------------------------------------------------------- /angularjs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular Demo 用户管理 6 | 7 | 8 | 9 |

用户管理

10 | 增加 11 |
12 | loading... 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /angularjs/demo_exp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test 6 | 7 | 8 | 9 |
10 | {{name | uppercase}} 11 | 1+2={{1+2}} 12 | {{3*10 | currency}} 13 | {{123.234 | number:2}} 14 | Name: 15 | 16 | {{a.b.c()}} 17 |
18 | 19 | 20 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /angularjs/demo_dsl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test 6 | 7 | 8 | 9 |
10 | {{name}} 11 |
12 | Hello
13 |
14 |
15 |
16 |
17 |
18 | 19 | 20 | : 21 | 24 |
25 | 26 | 27 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /angularjs/demo_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test 6 | 7 | 8 |
9 |

{{greeting.text}}, Word

10 |
{{test.text}}
11 |
12 |
13 |
14 |
15 | 16 | result: {{needed}} 17 |
18 |
19 | 20 | 21 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /angularjs/demo_curd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | curd 6 | 7 | 8 | 9 |
10 | Invoice: 11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
QuantityCost
20 |
21 | Total: {{qty * cost | currency: "RMB ¥"}} 22 |
23 | 24 | 25 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /angularjs/js/controller.js: -------------------------------------------------------------------------------- 1 | // 定义一个模块, 并引入依赖的angular模块 2 | var umService = angular.module( 'UserManage', [ 'ngRoute' ] ); 3 | 4 | function umRouteConfig ( $routeProvider ) { 5 | // console.log( $routeProvider ); 6 | $routeProvider 7 | .when( '/', { 8 | controller: ListController, 9 | templateUrl: 'list.html' 10 | }) 11 | .when( '/update/:id/:age', { 12 | controller: UpdateController, 13 | templateUrl: 'detail.html' 14 | }) 15 | .when( '/delete', { 16 | 17 | }) 18 | .otherwise({ 19 | redirectTo: '/' 20 | }); 21 | } 22 | 23 | umService.config( umRouteConfig ); 24 | 25 | function ListController ( $scope, $http ) { 26 | $http.get( 'server/user.json' ).success( function ( data, status, headers, config ) { 27 | console.log( data ); 28 | $scope.users = data; 29 | }); 30 | } 31 | 32 | function UpdateController ( $scope, $http, $routeParams ) { 33 | var id = $routeParams.id; 34 | // var age = $routeParams.age; 35 | // console.log( id ); 36 | $http.get( 'server/user.json' ).success( function ( data, status, headers, config ) { 37 | // console.log( data[ id ] ); 38 | $scope.xiuUser = getObjById( id, data ); 39 | }); 40 | 41 | $scope.update = function () { 42 | // console.log( $scope.xiuUser ) 43 | $http.get( 'server/user.json', { params: $scope.xiuUser } ); 44 | } 45 | } 46 | 47 | function getObjById ( id, obj ) { 48 | var len = obj.length; 49 | for(var i=0; i 2 | 3 | 4 | 5 | test 6 | 7 | 8 | 9 |
10 |
11 | Name: 12 |
13 | E-mail:
14 | Gender: male 15 | female
16 | 17 | 18 |
19 | 20 |
form = {{user | json}}
21 |
master = {{master | json}}
22 |
23 | 24 | 33 | 34 | 35 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /angularjs/js/angular-route.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.2.20 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(n,e,A){'use strict';function x(s,g,k){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,w){function y(){p&&(p.remove(),p=null);h&&(h.$destroy(),h=null);l&&(k.leave(l,function(){p=null}),p=l,l=null)}function v(){var b=s.current&&s.current.locals;if(e.isDefined(b&&b.$template)){var b=a.$new(),d=s.current;l=w(b,function(d){k.enter(d,null,l||c,function(){!e.isDefined(t)||t&&!a.$eval(t)||g()});y()});h=d.scope=b;h.$emit("$viewContentLoaded");h.$eval(u)}else y()} 7 | var h,l,p,t=b.autoscroll,u=b.onload||"";a.$on("$routeChangeSuccess",v);v()}}}function z(e,g,k){return{restrict:"ECA",priority:-400,link:function(a,c){var b=k.current,f=b.locals;c.html(f.$template);var w=e(c.contents());b.controller&&(f.$scope=a,f=g(b.controller,f),b.controllerAs&&(a[b.controllerAs]=f),c.data("$ngControllerController",f),c.children().data("$ngControllerController",f));w(a)}}}n=e.module("ngRoute",["ng"]).provider("$route",function(){function s(a,c){return e.extend(new (e.extend(function(){}, 8 | {prototype:a})),c)}function g(a,e){var b=e.caseInsensitiveMatch,f={originalPath:a,regexp:a},k=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,e,b,c){a="?"===c?c:null;c="*"===c?c:null;k.push({name:b,optional:!!a});e=e||"";return""+(a?"":e)+"(?:"+(a?e:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=RegExp("^"+a+"$",b?"i":"");return f}var k={};this.when=function(a,c){k[a]=e.extend({reloadOnSearch:!0},c,a&&g(a,c));if(a){var b= 9 | "/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";k[b]=e.extend({redirectTo:a},g(b,c))}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(a,c,b,f,g,n,v,h){function l(){var d=p(),m=r.current;if(d&&m&&d.$$route===m.$$route&&e.equals(d.pathParams,m.pathParams)&&!d.reloadOnSearch&&!u)m.params=d.params,e.copy(m.params,b),a.$broadcast("$routeUpdate",m);else if(d||m)u=!1,a.$broadcast("$routeChangeStart", 10 | d,m),(r.current=d)&&d.redirectTo&&(e.isString(d.redirectTo)?c.path(t(d.redirectTo,d.params)).search(d.params).replace():c.url(d.redirectTo(d.pathParams,c.path(),c.search())).replace()),f.when(d).then(function(){if(d){var a=e.extend({},d.resolve),c,b;e.forEach(a,function(d,c){a[c]=e.isString(d)?g.get(d):g.invoke(d)});e.isDefined(c=d.template)?e.isFunction(c)&&(c=c(d.params)):e.isDefined(b=d.templateUrl)&&(e.isFunction(b)&&(b=b(d.params)),b=h.getTrustedResourceUrl(b),e.isDefined(b)&&(d.loadedTemplateUrl= 11 | b,c=n.get(b,{cache:v}).then(function(a){return a.data})));e.isDefined(c)&&(a.$template=c);return f.all(a)}}).then(function(c){d==r.current&&(d&&(d.locals=c,e.copy(d.params,b)),a.$broadcast("$routeChangeSuccess",d,m))},function(c){d==r.current&&a.$broadcast("$routeChangeError",d,m,c)})}function p(){var a,b;e.forEach(k,function(f,k){var q;if(q=!b){var g=c.path();q=f.keys;var l={};if(f.regexp)if(g=f.regexp.exec(g)){for(var h=1,p=g.length;h 22 | */ 23 | /* global -ngRouteModule */ 24 | var ngRouteModule = angular.module('ngRoute', ['ng']). 25 | provider('$route', $RouteProvider); 26 | 27 | /** 28 | * @ngdoc provider 29 | * @name $routeProvider 30 | * @kind function 31 | * 32 | * @description 33 | * 34 | * Used for configuring routes. 35 | * 36 | * ## Example 37 | * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`. 38 | * 39 | * ## Dependencies 40 | * Requires the {@link ngRoute `ngRoute`} module to be installed. 41 | */ 42 | function $RouteProvider(){ 43 | function inherit(parent, extra) { 44 | return angular.extend(new (angular.extend(function() {}, {prototype:parent}))(), extra); 45 | } 46 | 47 | var routes = {}; 48 | 49 | /** 50 | * @ngdoc method 51 | * @name $routeProvider#when 52 | * 53 | * @param {string} path Route path (matched against `$location.path`). If `$location.path` 54 | * contains redundant trailing slash or is missing one, the route will still match and the 55 | * `$location.path` will be updated to add or drop the trailing slash to exactly match the 56 | * route definition. 57 | * 58 | * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up 59 | * to the next slash are matched and stored in `$routeParams` under the given `name` 60 | * when the route matches. 61 | * * `path` can contain named groups starting with a colon and ending with a star: 62 | * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name` 63 | * when the route matches. 64 | * * `path` can contain optional named groups with a question mark: e.g.`:name?`. 65 | * 66 | * For example, routes like `/color/:color/largecode/:largecode*\/edit` will match 67 | * `/color/brown/largecode/code/with/slashes/edit` and extract: 68 | * 69 | * * `color: brown` 70 | * * `largecode: code/with/slashes`. 71 | * 72 | * 73 | * @param {Object} route Mapping information to be assigned to `$route.current` on route 74 | * match. 75 | * 76 | * Object properties: 77 | * 78 | * - `controller` – `{(string|function()=}` – Controller fn that should be associated with 79 | * newly created scope or the name of a {@link angular.Module#controller registered 80 | * controller} if passed as a string. 81 | * - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be 82 | * published to scope under the `controllerAs` name. 83 | * - `template` – `{string=|function()=}` – html template as a string or a function that 84 | * returns an html template as a string which should be used by {@link 85 | * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives. 86 | * This property takes precedence over `templateUrl`. 87 | * 88 | * If `template` is a function, it will be called with the following parameters: 89 | * 90 | * - `{Array.}` - route parameters extracted from the current 91 | * `$location.path()` by applying the current route 92 | * 93 | * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html 94 | * template that should be used by {@link ngRoute.directive:ngView ngView}. 95 | * 96 | * If `templateUrl` is a function, it will be called with the following parameters: 97 | * 98 | * - `{Array.}` - route parameters extracted from the current 99 | * `$location.path()` by applying the current route 100 | * 101 | * - `resolve` - `{Object.=}` - An optional map of dependencies which should 102 | * be injected into the controller. If any of these dependencies are promises, the router 103 | * will wait for them all to be resolved or one to be rejected before the controller is 104 | * instantiated. 105 | * If all the promises are resolved successfully, the values of the resolved promises are 106 | * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is 107 | * fired. If any of the promises are rejected the 108 | * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object 109 | * is: 110 | * 111 | * - `key` – `{string}`: a name of a dependency to be injected into the controller. 112 | * - `factory` - `{string|function}`: If `string` then it is an alias for a service. 113 | * Otherwise if function, then it is {@link auto.$injector#invoke injected} 114 | * and the return value is treated as the dependency. If the result is a promise, it is 115 | * resolved before its value is injected into the controller. Be aware that 116 | * `ngRoute.$routeParams` will still refer to the previous route within these resolve 117 | * functions. Use `$route.current.params` to access the new route parameters, instead. 118 | * 119 | * - `redirectTo` – {(string|function())=} – value to update 120 | * {@link ng.$location $location} path with and trigger route redirection. 121 | * 122 | * If `redirectTo` is a function, it will be called with the following parameters: 123 | * 124 | * - `{Object.}` - route parameters extracted from the current 125 | * `$location.path()` by applying the current route templateUrl. 126 | * - `{string}` - current `$location.path()` 127 | * - `{Object}` - current `$location.search()` 128 | * 129 | * The custom `redirectTo` function is expected to return a string which will be used 130 | * to update `$location.path()` and `$location.search()`. 131 | * 132 | * - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()` 133 | * or `$location.hash()` changes. 134 | * 135 | * If the option is set to `false` and url in the browser changes, then 136 | * `$routeUpdate` event is broadcasted on the root scope. 137 | * 138 | * - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive 139 | * 140 | * If the option is set to `true`, then the particular route can be matched without being 141 | * case sensitive 142 | * 143 | * @returns {Object} self 144 | * 145 | * @description 146 | * Adds a new route definition to the `$route` service. 147 | */ 148 | this.when = function(path, route) { 149 | routes[path] = angular.extend( 150 | {reloadOnSearch: true}, 151 | route, 152 | path && pathRegExp(path, route) 153 | ); 154 | 155 | // create redirection for trailing slashes 156 | if (path) { 157 | var redirectPath = (path[path.length-1] == '/') 158 | ? path.substr(0, path.length-1) 159 | : path +'/'; 160 | 161 | routes[redirectPath] = angular.extend( 162 | {redirectTo: path}, 163 | pathRegExp(redirectPath, route) 164 | ); 165 | } 166 | 167 | return this; 168 | }; 169 | 170 | /** 171 | * @param path {string} path 172 | * @param opts {Object} options 173 | * @return {?Object} 174 | * 175 | * @description 176 | * Normalizes the given path, returning a regular expression 177 | * and the original path. 178 | * 179 | * Inspired by pathRexp in visionmedia/express/lib/utils.js. 180 | */ 181 | function pathRegExp(path, opts) { 182 | var insensitive = opts.caseInsensitiveMatch, 183 | ret = { 184 | originalPath: path, 185 | regexp: path 186 | }, 187 | keys = ret.keys = []; 188 | 189 | path = path 190 | .replace(/([().])/g, '\\$1') 191 | .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option){ 192 | var optional = option === '?' ? option : null; 193 | var star = option === '*' ? option : null; 194 | keys.push({ name: key, optional: !!optional }); 195 | slash = slash || ''; 196 | return '' 197 | + (optional ? '' : slash) 198 | + '(?:' 199 | + (optional ? slash : '') 200 | + (star && '(.+?)' || '([^/]+)') 201 | + (optional || '') 202 | + ')' 203 | + (optional || ''); 204 | }) 205 | .replace(/([\/$\*])/g, '\\$1'); 206 | 207 | ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : ''); 208 | return ret; 209 | } 210 | 211 | /** 212 | * @ngdoc method 213 | * @name $routeProvider#otherwise 214 | * 215 | * @description 216 | * Sets route definition that will be used on route change when no other route definition 217 | * is matched. 218 | * 219 | * @param {Object} params Mapping information to be assigned to `$route.current`. 220 | * @returns {Object} self 221 | */ 222 | this.otherwise = function(params) { 223 | this.when(null, params); 224 | return this; 225 | }; 226 | 227 | 228 | this.$get = ['$rootScope', 229 | '$location', 230 | '$routeParams', 231 | '$q', 232 | '$injector', 233 | '$http', 234 | '$templateCache', 235 | '$sce', 236 | function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache, $sce) { 237 | 238 | /** 239 | * @ngdoc service 240 | * @name $route 241 | * @requires $location 242 | * @requires $routeParams 243 | * 244 | * @property {Object} current Reference to the current route definition. 245 | * The route definition contains: 246 | * 247 | * - `controller`: The controller constructor as define in route definition. 248 | * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for 249 | * controller instantiation. The `locals` contain 250 | * the resolved values of the `resolve` map. Additionally the `locals` also contain: 251 | * 252 | * - `$scope` - The current route scope. 253 | * - `$template` - The current route template HTML. 254 | * 255 | * @property {Object} routes Object with all route configuration Objects as its properties. 256 | * 257 | * @description 258 | * `$route` is used for deep-linking URLs to controllers and views (HTML partials). 259 | * It watches `$location.url()` and tries to map the path to an existing route definition. 260 | * 261 | * Requires the {@link ngRoute `ngRoute`} module to be installed. 262 | * 263 | * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API. 264 | * 265 | * The `$route` service is typically used in conjunction with the 266 | * {@link ngRoute.directive:ngView `ngView`} directive and the 267 | * {@link ngRoute.$routeParams `$routeParams`} service. 268 | * 269 | * @example 270 | * This example shows how changing the URL hash causes the `$route` to match a route against the 271 | * URL, and the `ngView` pulls in the partial. 272 | * 273 | * Note that this example is using {@link ng.directive:script inlined templates} 274 | * to get it working on jsfiddle as well. 275 | * 276 | * 278 | * 279 | *
280 | * Choose: 281 | * Moby | 282 | * Moby: Ch1 | 283 | * Gatsby | 284 | * Gatsby: Ch4 | 285 | * Scarlet Letter
286 | * 287 | *
288 | * 289 | *
290 | * 291 | *
$location.path() = {{$location.path()}}
292 | *
$route.current.templateUrl = {{$route.current.templateUrl}}
293 | *
$route.current.params = {{$route.current.params}}
294 | *
$route.current.scope.name = {{$route.current.scope.name}}
295 | *
$routeParams = {{$routeParams}}
296 | *
297 | *
298 | * 299 | * 300 | * controller: {{name}}
301 | * Book Id: {{params.bookId}}
302 | *
303 | * 304 | * 305 | * controller: {{name}}
306 | * Book Id: {{params.bookId}}
307 | * Chapter Id: {{params.chapterId}} 308 | *
309 | * 310 | * 311 | * angular.module('ngRouteExample', ['ngRoute']) 312 | * 313 | * .controller('MainController', function($scope, $route, $routeParams, $location) { 314 | * $scope.$route = $route; 315 | * $scope.$location = $location; 316 | * $scope.$routeParams = $routeParams; 317 | * }) 318 | * 319 | * .controller('BookController', function($scope, $routeParams) { 320 | * $scope.name = "BookController"; 321 | * $scope.params = $routeParams; 322 | * }) 323 | * 324 | * .controller('ChapterController', function($scope, $routeParams) { 325 | * $scope.name = "ChapterController"; 326 | * $scope.params = $routeParams; 327 | * }) 328 | * 329 | * .config(function($routeProvider, $locationProvider) { 330 | * $routeProvider 331 | * .when('/Book/:bookId', { 332 | * templateUrl: 'book.html', 333 | * controller: 'BookController', 334 | * resolve: { 335 | * // I will cause a 1 second delay 336 | * delay: function($q, $timeout) { 337 | * var delay = $q.defer(); 338 | * $timeout(delay.resolve, 1000); 339 | * return delay.promise; 340 | * } 341 | * } 342 | * }) 343 | * .when('/Book/:bookId/ch/:chapterId', { 344 | * templateUrl: 'chapter.html', 345 | * controller: 'ChapterController' 346 | * }); 347 | * 348 | * // configure html5 to get links working on jsfiddle 349 | * $locationProvider.html5Mode(true); 350 | * }); 351 | * 352 | * 353 | * 354 | * 355 | * it('should load and compile correct template', function() { 356 | * element(by.linkText('Moby: Ch1')).click(); 357 | * var content = element(by.css('[ng-view]')).getText(); 358 | * expect(content).toMatch(/controller\: ChapterController/); 359 | * expect(content).toMatch(/Book Id\: Moby/); 360 | * expect(content).toMatch(/Chapter Id\: 1/); 361 | * 362 | * element(by.partialLinkText('Scarlet')).click(); 363 | * 364 | * content = element(by.css('[ng-view]')).getText(); 365 | * expect(content).toMatch(/controller\: BookController/); 366 | * expect(content).toMatch(/Book Id\: Scarlet/); 367 | * }); 368 | * 369 | *
370 | */ 371 | 372 | /** 373 | * @ngdoc event 374 | * @name $route#$routeChangeStart 375 | * @eventType broadcast on root scope 376 | * @description 377 | * Broadcasted before a route change. At this point the route services starts 378 | * resolving all of the dependencies needed for the route change to occur. 379 | * Typically this involves fetching the view template as well as any dependencies 380 | * defined in `resolve` route property. Once all of the dependencies are resolved 381 | * `$routeChangeSuccess` is fired. 382 | * 383 | * @param {Object} angularEvent Synthetic event object. 384 | * @param {Route} next Future route information. 385 | * @param {Route} current Current route information. 386 | */ 387 | 388 | /** 389 | * @ngdoc event 390 | * @name $route#$routeChangeSuccess 391 | * @eventType broadcast on root scope 392 | * @description 393 | * Broadcasted after a route dependencies are resolved. 394 | * {@link ngRoute.directive:ngView ngView} listens for the directive 395 | * to instantiate the controller and render the view. 396 | * 397 | * @param {Object} angularEvent Synthetic event object. 398 | * @param {Route} current Current route information. 399 | * @param {Route|Undefined} previous Previous route information, or undefined if current is 400 | * first route entered. 401 | */ 402 | 403 | /** 404 | * @ngdoc event 405 | * @name $route#$routeChangeError 406 | * @eventType broadcast on root scope 407 | * @description 408 | * Broadcasted if any of the resolve promises are rejected. 409 | * 410 | * @param {Object} angularEvent Synthetic event object 411 | * @param {Route} current Current route information. 412 | * @param {Route} previous Previous route information. 413 | * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise. 414 | */ 415 | 416 | /** 417 | * @ngdoc event 418 | * @name $route#$routeUpdate 419 | * @eventType broadcast on root scope 420 | * @description 421 | * 422 | * The `reloadOnSearch` property has been set to false, and we are reusing the same 423 | * instance of the Controller. 424 | */ 425 | 426 | var forceReload = false, 427 | $route = { 428 | routes: routes, 429 | 430 | /** 431 | * @ngdoc method 432 | * @name $route#reload 433 | * 434 | * @description 435 | * Causes `$route` service to reload the current route even if 436 | * {@link ng.$location $location} hasn't changed. 437 | * 438 | * As a result of that, {@link ngRoute.directive:ngView ngView} 439 | * creates new scope, reinstantiates the controller. 440 | */ 441 | reload: function() { 442 | forceReload = true; 443 | $rootScope.$evalAsync(updateRoute); 444 | } 445 | }; 446 | 447 | $rootScope.$on('$locationChangeSuccess', updateRoute); 448 | 449 | return $route; 450 | 451 | ///////////////////////////////////////////////////// 452 | 453 | /** 454 | * @param on {string} current url 455 | * @param route {Object} route regexp to match the url against 456 | * @return {?Object} 457 | * 458 | * @description 459 | * Check if the route matches the current url. 460 | * 461 | * Inspired by match in 462 | * visionmedia/express/lib/router/router.js. 463 | */ 464 | function switchRouteMatcher(on, route) { 465 | var keys = route.keys, 466 | params = {}; 467 | 468 | if (!route.regexp) return null; 469 | 470 | var m = route.regexp.exec(on); 471 | if (!m) return null; 472 | 473 | for (var i = 1, len = m.length; i < len; ++i) { 474 | var key = keys[i - 1]; 475 | 476 | var val = 'string' == typeof m[i] 477 | ? decodeURIComponent(m[i]) 478 | : m[i]; 479 | 480 | if (key && val) { 481 | params[key.name] = val; 482 | } 483 | } 484 | return params; 485 | } 486 | 487 | function updateRoute() { 488 | var next = parseRoute(), 489 | last = $route.current; 490 | 491 | if (next && last && next.$$route === last.$$route 492 | && angular.equals(next.pathParams, last.pathParams) 493 | && !next.reloadOnSearch && !forceReload) { 494 | last.params = next.params; 495 | angular.copy(last.params, $routeParams); 496 | $rootScope.$broadcast('$routeUpdate', last); 497 | } else if (next || last) { 498 | forceReload = false; 499 | $rootScope.$broadcast('$routeChangeStart', next, last); 500 | $route.current = next; 501 | if (next) { 502 | if (next.redirectTo) { 503 | if (angular.isString(next.redirectTo)) { 504 | $location.path(interpolate(next.redirectTo, next.params)).search(next.params) 505 | .replace(); 506 | } else { 507 | $location.url(next.redirectTo(next.pathParams, $location.path(), $location.search())) 508 | .replace(); 509 | } 510 | } 511 | } 512 | 513 | $q.when(next). 514 | then(function() { 515 | if (next) { 516 | var locals = angular.extend({}, next.resolve), 517 | template, templateUrl; 518 | 519 | angular.forEach(locals, function(value, key) { 520 | locals[key] = angular.isString(value) ? 521 | $injector.get(value) : $injector.invoke(value); 522 | }); 523 | 524 | if (angular.isDefined(template = next.template)) { 525 | if (angular.isFunction(template)) { 526 | template = template(next.params); 527 | } 528 | } else if (angular.isDefined(templateUrl = next.templateUrl)) { 529 | if (angular.isFunction(templateUrl)) { 530 | templateUrl = templateUrl(next.params); 531 | } 532 | templateUrl = $sce.getTrustedResourceUrl(templateUrl); 533 | if (angular.isDefined(templateUrl)) { 534 | next.loadedTemplateUrl = templateUrl; 535 | template = $http.get(templateUrl, {cache: $templateCache}). 536 | then(function(response) { return response.data; }); 537 | } 538 | } 539 | if (angular.isDefined(template)) { 540 | locals['$template'] = template; 541 | } 542 | return $q.all(locals); 543 | } 544 | }). 545 | // after route change 546 | then(function(locals) { 547 | if (next == $route.current) { 548 | if (next) { 549 | next.locals = locals; 550 | angular.copy(next.params, $routeParams); 551 | } 552 | $rootScope.$broadcast('$routeChangeSuccess', next, last); 553 | } 554 | }, function(error) { 555 | if (next == $route.current) { 556 | $rootScope.$broadcast('$routeChangeError', next, last, error); 557 | } 558 | }); 559 | } 560 | } 561 | 562 | 563 | /** 564 | * @returns {Object} the current active route, by matching it against the URL 565 | */ 566 | function parseRoute() { 567 | // Match a route 568 | var params, match; 569 | angular.forEach(routes, function(route, path) { 570 | if (!match && (params = switchRouteMatcher($location.path(), route))) { 571 | match = inherit(route, { 572 | params: angular.extend({}, $location.search(), params), 573 | pathParams: params}); 574 | match.$$route = route; 575 | } 576 | }); 577 | // No route matched; fallback to "otherwise" route 578 | return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}}); 579 | } 580 | 581 | /** 582 | * @returns {string} interpolation of the redirect path with the parameters 583 | */ 584 | function interpolate(string, params) { 585 | var result = []; 586 | angular.forEach((string||'').split(':'), function(segment, i) { 587 | if (i === 0) { 588 | result.push(segment); 589 | } else { 590 | var segmentMatch = segment.match(/(\w+)(.*)/); 591 | var key = segmentMatch[1]; 592 | result.push(params[key]); 593 | result.push(segmentMatch[2] || ''); 594 | delete params[key]; 595 | } 596 | }); 597 | return result.join(''); 598 | } 599 | }]; 600 | } 601 | 602 | ngRouteModule.provider('$routeParams', $RouteParamsProvider); 603 | 604 | 605 | /** 606 | * @ngdoc service 607 | * @name $routeParams 608 | * @requires $route 609 | * 610 | * @description 611 | * The `$routeParams` service allows you to retrieve the current set of route parameters. 612 | * 613 | * Requires the {@link ngRoute `ngRoute`} module to be installed. 614 | * 615 | * The route parameters are a combination of {@link ng.$location `$location`}'s 616 | * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}. 617 | * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched. 618 | * 619 | * In case of parameter name collision, `path` params take precedence over `search` params. 620 | * 621 | * The service guarantees that the identity of the `$routeParams` object will remain unchanged 622 | * (but its properties will likely change) even when a route change occurs. 623 | * 624 | * Note that the `$routeParams` are only updated *after* a route change completes successfully. 625 | * This means that you cannot rely on `$routeParams` being correct in route resolve functions. 626 | * Instead you can use `$route.current.params` to access the new route's parameters. 627 | * 628 | * @example 629 | * ```js 630 | * // Given: 631 | * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby 632 | * // Route: /Chapter/:chapterId/Section/:sectionId 633 | * // 634 | * // Then 635 | * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'} 636 | * ``` 637 | */ 638 | function $RouteParamsProvider() { 639 | this.$get = function() { return {}; }; 640 | } 641 | 642 | ngRouteModule.directive('ngView', ngViewFactory); 643 | ngRouteModule.directive('ngView', ngViewFillContentFactory); 644 | 645 | 646 | /** 647 | * @ngdoc directive 648 | * @name ngView 649 | * @restrict ECA 650 | * 651 | * @description 652 | * # Overview 653 | * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by 654 | * including the rendered template of the current route into the main layout (`index.html`) file. 655 | * Every time the current route changes, the included view changes with it according to the 656 | * configuration of the `$route` service. 657 | * 658 | * Requires the {@link ngRoute `ngRoute`} module to be installed. 659 | * 660 | * @animations 661 | * enter - animation is used to bring new content into the browser. 662 | * leave - animation is used to animate existing content away. 663 | * 664 | * The enter and leave animation occur concurrently. 665 | * 666 | * @scope 667 | * @priority 400 668 | * @param {string=} onload Expression to evaluate whenever the view updates. 669 | * 670 | * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll 671 | * $anchorScroll} to scroll the viewport after the view is updated. 672 | * 673 | * - If the attribute is not set, disable scrolling. 674 | * - If the attribute is set without value, enable scrolling. 675 | * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated 676 | * as an expression yields a truthy value. 677 | * @example 678 | 681 | 682 |
683 | Choose: 684 | Moby | 685 | Moby: Ch1 | 686 | Gatsby | 687 | Gatsby: Ch4 | 688 | Scarlet Letter
689 | 690 |
691 |
692 |
693 |
694 | 695 |
$location.path() = {{main.$location.path()}}
696 |
$route.current.templateUrl = {{main.$route.current.templateUrl}}
697 |
$route.current.params = {{main.$route.current.params}}
698 |
$route.current.scope.name = {{main.$route.current.scope.name}}
699 |
$routeParams = {{main.$routeParams}}
700 |
701 |
702 | 703 | 704 |
705 | controller: {{book.name}}
706 | Book Id: {{book.params.bookId}}
707 |
708 |
709 | 710 | 711 |
712 | controller: {{chapter.name}}
713 | Book Id: {{chapter.params.bookId}}
714 | Chapter Id: {{chapter.params.chapterId}} 715 |
716 |
717 | 718 | 719 | .view-animate-container { 720 | position:relative; 721 | height:100px!important; 722 | position:relative; 723 | background:white; 724 | border:1px solid black; 725 | height:40px; 726 | overflow:hidden; 727 | } 728 | 729 | .view-animate { 730 | padding:10px; 731 | } 732 | 733 | .view-animate.ng-enter, .view-animate.ng-leave { 734 | -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; 735 | transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; 736 | 737 | display:block; 738 | width:100%; 739 | border-left:1px solid black; 740 | 741 | position:absolute; 742 | top:0; 743 | left:0; 744 | right:0; 745 | bottom:0; 746 | padding:10px; 747 | } 748 | 749 | .view-animate.ng-enter { 750 | left:100%; 751 | } 752 | .view-animate.ng-enter.ng-enter-active { 753 | left:0; 754 | } 755 | .view-animate.ng-leave.ng-leave-active { 756 | left:-100%; 757 | } 758 | 759 | 760 | 761 | angular.module('ngViewExample', ['ngRoute', 'ngAnimate']) 762 | .config(['$routeProvider', '$locationProvider', 763 | function($routeProvider, $locationProvider) { 764 | $routeProvider 765 | .when('/Book/:bookId', { 766 | templateUrl: 'book.html', 767 | controller: 'BookCtrl', 768 | controllerAs: 'book' 769 | }) 770 | .when('/Book/:bookId/ch/:chapterId', { 771 | templateUrl: 'chapter.html', 772 | controller: 'ChapterCtrl', 773 | controllerAs: 'chapter' 774 | }); 775 | 776 | // configure html5 to get links working on jsfiddle 777 | $locationProvider.html5Mode(true); 778 | }]) 779 | .controller('MainCtrl', ['$route', '$routeParams', '$location', 780 | function($route, $routeParams, $location) { 781 | this.$route = $route; 782 | this.$location = $location; 783 | this.$routeParams = $routeParams; 784 | }]) 785 | .controller('BookCtrl', ['$routeParams', function($routeParams) { 786 | this.name = "BookCtrl"; 787 | this.params = $routeParams; 788 | }]) 789 | .controller('ChapterCtrl', ['$routeParams', function($routeParams) { 790 | this.name = "ChapterCtrl"; 791 | this.params = $routeParams; 792 | }]); 793 | 794 | 795 | 796 | 797 | it('should load and compile correct template', function() { 798 | element(by.linkText('Moby: Ch1')).click(); 799 | var content = element(by.css('[ng-view]')).getText(); 800 | expect(content).toMatch(/controller\: ChapterCtrl/); 801 | expect(content).toMatch(/Book Id\: Moby/); 802 | expect(content).toMatch(/Chapter Id\: 1/); 803 | 804 | element(by.partialLinkText('Scarlet')).click(); 805 | 806 | content = element(by.css('[ng-view]')).getText(); 807 | expect(content).toMatch(/controller\: BookCtrl/); 808 | expect(content).toMatch(/Book Id\: Scarlet/); 809 | }); 810 | 811 |
812 | */ 813 | 814 | 815 | /** 816 | * @ngdoc event 817 | * @name ngView#$viewContentLoaded 818 | * @eventType emit on the current ngView scope 819 | * @description 820 | * Emitted every time the ngView content is reloaded. 821 | */ 822 | ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate']; 823 | function ngViewFactory( $route, $anchorScroll, $animate) { 824 | return { 825 | restrict: 'ECA', 826 | terminal: true, 827 | priority: 400, 828 | transclude: 'element', 829 | link: function(scope, $element, attr, ctrl, $transclude) { 830 | var currentScope, 831 | currentElement, 832 | previousElement, 833 | autoScrollExp = attr.autoscroll, 834 | onloadExp = attr.onload || ''; 835 | 836 | scope.$on('$routeChangeSuccess', update); 837 | update(); 838 | 839 | function cleanupLastView() { 840 | if(previousElement) { 841 | previousElement.remove(); 842 | previousElement = null; 843 | } 844 | if(currentScope) { 845 | currentScope.$destroy(); 846 | currentScope = null; 847 | } 848 | if(currentElement) { 849 | $animate.leave(currentElement, function() { 850 | previousElement = null; 851 | }); 852 | previousElement = currentElement; 853 | currentElement = null; 854 | } 855 | } 856 | 857 | function update() { 858 | var locals = $route.current && $route.current.locals, 859 | template = locals && locals.$template; 860 | 861 | if (angular.isDefined(template)) { 862 | var newScope = scope.$new(); 863 | var current = $route.current; 864 | 865 | // Note: This will also link all children of ng-view that were contained in the original 866 | // html. If that content contains controllers, ... they could pollute/change the scope. 867 | // However, using ng-view on an element with additional content does not make sense... 868 | // Note: We can't remove them in the cloneAttchFn of $transclude as that 869 | // function is called before linking the content, which would apply child 870 | // directives to non existing elements. 871 | var clone = $transclude(newScope, function(clone) { 872 | $animate.enter(clone, null, currentElement || $element, function onNgViewEnter () { 873 | if (angular.isDefined(autoScrollExp) 874 | && (!autoScrollExp || scope.$eval(autoScrollExp))) { 875 | $anchorScroll(); 876 | } 877 | }); 878 | cleanupLastView(); 879 | }); 880 | 881 | currentElement = clone; 882 | currentScope = current.scope = newScope; 883 | currentScope.$emit('$viewContentLoaded'); 884 | currentScope.$eval(onloadExp); 885 | } else { 886 | cleanupLastView(); 887 | } 888 | } 889 | } 890 | }; 891 | } 892 | 893 | // This directive is called during the $transclude call of the first `ngView` directive. 894 | // It will replace and compile the content of the element with the loaded template. 895 | // We need this directive so that the element content is already filled when 896 | // the link function of another directive on the same element as ngView 897 | // is called. 898 | ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route']; 899 | function ngViewFillContentFactory($compile, $controller, $route) { 900 | return { 901 | restrict: 'ECA', 902 | priority: -400, 903 | link: function(scope, $element) { 904 | var current = $route.current, 905 | locals = current.locals; 906 | 907 | $element.html(locals.$template); 908 | 909 | var link = $compile($element.contents()); 910 | 911 | if (current.controller) { 912 | locals.$scope = scope; 913 | var controller = $controller(current.controller, locals); 914 | if (current.controllerAs) { 915 | scope[current.controllerAs] = controller; 916 | } 917 | $element.data('$ngControllerController', controller); 918 | $element.children().data('$ngControllerController', controller); 919 | } 920 | 921 | link(scope); 922 | } 923 | }; 924 | } 925 | 926 | 927 | })(window, window.angular); 928 | -------------------------------------------------------------------------------- /angularjs/js/angular.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.2.20 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(S,U,s){'use strict';function v(b){return function(){var a=arguments[0],c,a="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.2.20/"+(b?b+"/":"")+a;for(c=1;c").append(b).html();try{return 3===b[0].nodeType?I(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+I(b)})}catch(d){return I(c)}}function ac(b){try{return decodeURIComponent(b)}catch(a){}}function bc(b){var a={},c,d;q((b||"").split("&"),function(b){b&&(c=b.split("="),d=ac(c[0]),B(d)&&(b=B(c[1])?ac(c[1]):!0,gb.call(a,d)?L(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))}); 16 | return a}function Ab(b){var a=[];q(b,function(b,d){L(b)?q(b,function(b){a.push(Aa(d,!0)+(!0===b?"":"="+Aa(b,!0)))}):a.push(Aa(d,!0)+(!0===b?"":"="+Aa(b,!0)))});return a.length?a.join("&"):""}function hb(b){return Aa(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Aa(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function Xc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,f= 17 | ["ng:app","ng-app","x-ng-app","data-ng-app"],k=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;q(f,function(a){f[a]=!0;c(U.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(q(b.querySelectorAll("."+a),c),q(b.querySelectorAll("."+a+"\\:"),c),q(b.querySelectorAll("["+a+"]"),c))});q(d,function(a){if(!e){var b=k.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):q(a.attributes,function(b){!e&&f[b.name]&&(e=a,g=b.value)})}});e&&a(e,g?[g]:[])}function cc(b,a){var c=function(){b=x(b);if(b.injector()){var c= 18 | b[0]===U?"document":ga(b);throw Ra("btstrpd",c);}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");c=dc(a);c.invoke(["$rootScope","$rootElement","$compile","$injector","$animate",function(a,b,c,d,e){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(S&&!d.test(S.name))return c();S.name=S.name.replace(d,"");Ta.resumeBootstrap=function(b){q(b,function(b){a.push(b)});c()}}function ib(b,a){a=a||"_";return b.replace(Yc,function(b, 19 | d){return(d?a:"")+b.toLowerCase()})}function Bb(b,a,c){if(!b)throw Ra("areq",a||"?",c||"required");return b}function Ua(b,a,c){c&&L(b)&&(b=b[b.length-1]);Bb(O(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ba(b,a){if("hasOwnProperty"===b)throw Ra("badname",a);}function ec(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,g=a.length,f=0;f "+e[1]+a.replace(me,"<$1>")+e[2];d.removeChild(d.firstChild);for(a=e[0];a--;)d=d.lastChild;a=0;for(e=d.childNodes.length;a=P?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function Ja(b,a){var c=typeof b,d;"function"==c||"object"==c&&null!==b?"function"==typeof(d= 32 | b.$$hashKey)?d=b.$$hashKey():d===s&&(d=b.$$hashKey=(a||eb)()):d=b;return c+":"+d}function Za(b,a){if(a){var c=0;this.nextUid=function(){return++c}}q(b,this.put,this)}function rc(b){var a,c;"function"===typeof b?(a=b.$inject)||(a=[],b.length&&(c=b.toString().replace(pe,""),c=c.match(qe),q(c[1].split(re),function(b){b.replace(se,function(b,c,d){a.push(d)})})),b.$inject=a):L(b)?(c=b.length-1,Ua(b[c],"fn"),a=b.slice(0,c)):Ua(b,"fn",!0);return a}function dc(b){function a(a){return function(b,c){if(T(b))q(b, 33 | Wb(a));else return a(b,c)}}function c(a,b){Ba(a,"service");if(O(b)||L(b))b=p.instantiate(b);if(!b.$get)throw $a("pget",a);return l[a+k]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[],c,d,g,k;q(a,function(a){if(!h.get(a)){h.put(a,!0);try{if(y(a))for(c=Va(a),b=b.concat(e(c.requires)).concat(c._runBlocks),d=c._invokeQueue,g=0,k=d.length;g 4096 bytes)!"));else{if(m.cookie!==ea)for(ea=m.cookie, 41 | d=ea.split("; "),M={},g=0;gh&&this.remove(n.key),b},get:function(a){if(h").parent()[0])});var g=N(a,b,a,c,d,e);da(a,"ng-scope");return function(b,c,d,e){Bb(b,"scope");var f=c?Ka.clone.call(a):a;q(d,function(a,b){f.data("$"+b+"Controller",a)});d=0;for(var m=f.length;d 52 | arguments.length&&(b=a,a=s);Da&&(c=ea);return n(a,b,c)}var u,Q,z,D,X,C,ea={},nb;u=c===g?d:ka(d,new Kb(x(g),d.$attr));Q=u.$$element;if(M){var ca=/^\s*([@=&])(\??)\s*(\w*)\s*$/;f=x(g);C=e.$new(!0);!H||H!==M&&H!==M.$$originalDirective?f.data("$isolateScopeNoTemplate",C):f.data("$isolateScope",C);da(f,"ng-isolate-scope");q(M.scope,function(a,c){var d=a.match(ca)||[],g=d[3]||c,f="?"==d[2],d=d[1],m,l,p,n;C.$$isolateBindings[c]=d+g;switch(d){case "@":u.$observe(g,function(a){C[c]=a});u.$$observers[g].$$scope= 53 | e;u[g]&&(C[c]=b(u[g])(e));break;case "=":if(f&&!u[g])break;l=r(u[g]);n=l.literal?ya:function(a,b){return a===b};p=l.assign||function(){m=C[c]=l(e);throw ha("nonassign",u[g],M.name);};m=C[c]=l(e);C.$watch(function(){var a=l(e);n(a,C[c])||(n(a,m)?p(e,a=C[c]):C[c]=a);return m=a},null,l.literal);break;case "&":l=r(u[g]);C[c]=function(a){return l(e,a)};break;default:throw ha("iscp",M.name,c,a);}})}nb=n&&w;N&&q(N,function(a){var b={$scope:a===M||a.$$isolateScope?C:e,$element:Q,$attrs:u,$transclude:nb}, 54 | c;X=a.controller;"@"==X&&(X=u[a.name]);c=t(X,b);ea[a.name]=c;Da||Q.data("$"+a.name+"Controller",c);a.controllerAs&&(b.$scope[a.controllerAs]=c)});f=0;for(z=m.length;fG.priority)break;if(W=G.scope)X=X||G,G.templateUrl||(I("new/isolated scope",M,G,v),T(W)&&(M=G));na=G.name;!G.templateUrl&&G.controller&&(W=G.controller,N=N||{},I("'"+na+"' controller",N[na],G,v),N[na]=G);if(W=G.transclude)F= 56 | !0,G.$$tlb||(I("transclusion",ca,G,v),ca=G),"element"==W?(Da=!0,u=G.priority,W=C(c,V,Y),v=d.$$element=x(U.createComment(" "+na+": "+d[na]+" ")),c=v[0],ob(g,x(za.call(W,0)),c),S=z(W,e,u,f&&f.name,{nonTlbTranscludeDirective:ca})):(W=x(Ib(c)).contents(),v.empty(),S=z(W,e));if(G.template)if(E=!0,I("template",H,G,v),H=G,W=O(G.template)?G.template(v,d):G.template,W=Z(W),G.replace){f=G;W=Gb.test(W)?x(aa(W)):[];c=W[0];if(1!=W.length||1!==c.nodeType)throw ha("tplrt",na,"");ob(g,v,c);oa={$attr:{}};W=ea(c,[], 57 | oa);var $=a.splice(P+1,a.length-(P+1));M&&sc(W);a=a.concat(W).concat($);B(d,oa);oa=a.length}else v.html(W);if(G.templateUrl)E=!0,I("template",H,G,v),H=G,G.replace&&(f=G),K=A(a.splice(P,a.length-P),v,d,g,F&&S,m,p,{controllerDirectives:N,newIsolateScopeDirective:M,templateDirective:H,nonTlbTranscludeDirective:ca}),oa=a.length;else if(G.compile)try{R=G.compile(v,d,S),O(R)?w(null,R,V,Y):R&&w(R.pre,R.post,V,Y)}catch(ba){l(ba,ga(v))}G.terminal&&(K.terminal=!0,u=Math.max(u,G.priority))}K.scope=X&&!0===X.scope; 58 | K.transcludeOnThisElement=F;K.templateOnThisElement=E;K.transclude=S;n.hasElementTranscludeDirective=Da;return K}function sc(a){for(var b=0,c=a.length;bn.priority)&&-1!=n.restrict.indexOf(g)&&(r&&(n=Yb(n,{$$start:r,$$end:p})),b.push(n),h=n)}catch(J){l(J)}}return h}function B(a,b){var c=b.$attr,d=a.$attr,e=a.$$element; 59 | q(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,g){"class"==g?(da(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==g?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==g.charAt(0)||a.hasOwnProperty(g)||(a[g]=b,d[g]=c[g])})}function A(a,b,c,d,e,g,f,m){var h=[],l,r,t=b[0],w=a.shift(),J=E({},w,{templateUrl:null,transclude:null,replace:null,$$originalDirective:w}),K=O(w.templateUrl)?w.templateUrl(b, 60 | c):w.templateUrl;b.empty();p.get(u.getTrustedResourceUrl(K),{cache:n}).success(function(p){var n,u;p=Z(p);if(w.replace){p=Gb.test(p)?x(aa(p)):[];n=p[0];if(1!=p.length||1!==n.nodeType)throw ha("tplrt",w.name,K);p={$attr:{}};ob(d,b,n);var z=ea(n,[],p);T(w.scope)&&sc(z);a=z.concat(a);B(c,p)}else n=t,b.html(p);a.unshift(J);l=H(a,n,c,e,b,w,g,f,m);q(d,function(a,c){a==n&&(d[c]=b[0])});for(r=N(b[0].childNodes,e);h.length;){p=h.shift();u=h.shift();var D=h.shift(),X=h.shift(),z=b[0];if(u!==t){var C=u.className; 61 | m.hasElementTranscludeDirective&&w.replace||(z=Ib(n));ob(D,x(u),z);da(x(z),C)}u=l.transcludeOnThisElement?M(p,l.transclude,X):X;l(r,p,z,d,u)}h=null}).error(function(a,b,c,d){throw ha("tpload",d.url);});return function(a,b,c,d,e){a=e;h?(h.push(b),h.push(c),h.push(d),h.push(a)):(l.transcludeOnThisElement&&(a=M(b,l.transclude,e)),l(r,b,c,d,a))}}function F(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.namea.status?d:p.reject(d)}var c={method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse},d=function(a){var b=e.headers,c=E({},a.headers),d,g,b=E({},b.common,b[I(a.method)]); 71 | a:for(d in b){a=I(d);for(g in c)if(I(g)===a)continue a;c[d]=b[d]}(function(a){var b;q(a,function(c,d){O(c)&&(b=c(),null!=b?a[d]=b:delete a[d])})})(c);return c}(a);E(c,a);c.headers=d;c.method=Ha(c.method);var g=[function(a){d=a.headers;var c=xc(a.data,wc(d),a.transformRequest);F(c)&&q(d,function(a,b){"content-type"===I(b)&&delete d[b]});F(a.withCredentials)&&!F(e.withCredentials)&&(a.withCredentials=e.withCredentials);return t(a,c,d).then(b,b)},s],f=p.when(c);for(q(u,function(a){(a.request||a.requestError)&& 72 | g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){a=g.shift();var m=g.shift(),f=f.then(a,m)}f.success=function(a){f.then(function(b){a(b.data,b.status,b.headers,c)});return f};f.error=function(a){f.then(null,function(b){a(b.data,b.status,b.headers,c)});return f};return f}function t(c,g,f){function h(a,b,c,e){D&&(200<=a&&300>a?D.put(x,[a,b,vc(c),e]):D.remove(x));n(b,a,c,e);d.$$phase||d.$apply()}function n(a,b,d,e){b=Math.max(b,0);(200<= 73 | b&&300>b?u.resolve:u.reject)({data:a,status:b,headers:wc(d),config:c,statusText:e})}function t(){var a=Pa(r.pendingRequests,c);-1!==a&&r.pendingRequests.splice(a,1)}var u=p.defer(),q=u.promise,D,H,x=J(c.url,c.params);r.pendingRequests.push(c);q.then(t,t);(c.cache||e.cache)&&(!1!==c.cache&&"GET"==c.method)&&(D=T(c.cache)?c.cache:T(e.cache)?e.cache:w);if(D)if(H=D.get(x),B(H)){if(H.then)return H.then(t,t),H;L(H)?n(H[1],H[0],ka(H[2]),H[3]):n(H,200,{},"OK")}else D.put(x,q);F(H)&&((H=Lb(c.url)?b.cookies()[c.xsrfCookieName|| 74 | e.xsrfCookieName]:s)&&(f[c.xsrfHeaderName||e.xsrfHeaderName]=H),a(c.method,x,g,h,f,c.timeout,c.withCredentials,c.responseType));return q}function J(a,b){if(!b)return a;var c=[];Tc(b,function(a,b){null===a||F(a)||(L(a)||(a=[a]),q(a,function(a){T(a)&&(a=sa(a));c.push(Aa(b)+"="+Aa(a))}))});0=P&&(!b.match(/^(get|post|head|put|delete|options)$/i)||!S.XMLHttpRequest))return new S.ActiveXObject("Microsoft.XMLHTTP");if(S.XMLHttpRequest)return new S.XMLHttpRequest; 76 | throw v("$httpBackend")("noxhr");}function Vd(){this.$get=["$browser","$window","$document",function(b,a,c){return we(b,ve,b.defer,a.angular.callbacks,c[0])}]}function we(b,a,c,d,e){function g(a,b,c){var g=e.createElement("script"),f=null;g.type="text/javascript";g.src=a;g.async=!0;f=function(a){Xa(g,"load",f);Xa(g,"error",f);e.body.removeChild(g);g=null;var k=-1,t="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),t=a.type,k="error"===a.type?404:200);c&&c(k,t)};pb(g,"load",f);pb(g,"error", 77 | f);8>=P&&(g.onreadystatechange=function(){y(g.readyState)&&/loaded|complete/.test(g.readyState)&&(g.onreadystatechange=null,f({type:"load"}))});e.body.appendChild(g);return f}var f=-1;return function(e,m,h,l,p,n,r,t){function J(){u=f;X&&X();z&&z.abort()}function w(a,d,e,g,f){N&&c.cancel(N);X=z=null;0===d&&(d=e?200:"file"==ta(m).protocol?404:0);a(1223===d?204:d,e,g,f||"");b.$$completeOutstandingRequest(A)}var u;b.$$incOutstandingRequestCount();m=m||b.url();if("jsonp"==I(e)){var K="_"+(d.counter++).toString(36); 78 | d[K]=function(a){d[K].data=a;d[K].called=!0};var X=g(m.replace("JSON_CALLBACK","angular.callbacks."+K),K,function(a,b){w(l,a,d[K].data,"",b);d[K]=A})}else{var z=a(e);z.open(e,m,!0);q(p,function(a,b){B(a)&&z.setRequestHeader(b,a)});z.onreadystatechange=function(){if(z&&4==z.readyState){var a=null,b=null,c="";u!==f&&(a=z.getAllResponseHeaders(),b="response"in z?z.response:z.responseText);u===f&&10>P||(c=z.statusText);w(l,u||z.status,b,a,c)}};r&&(z.withCredentials=!0);if(t)try{z.responseType=t}catch(da){if("json"!== 79 | t)throw da;}z.send(h||null)}if(0=k&&(p.resolve(r),l(n.$$intervalId),delete e[n.$$intervalId]);t||b.$apply()},f);e[n.$$intervalId]=p;return n}var e={};d.cancel=function(b){return b&&b.$$intervalId in e?(e[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete e[b.$$intervalId], 82 | !0):!1};return d}]}function bd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), 83 | DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function Mb(b){b=b.split("/");for(var a=b.length;a--;)b[a]=hb(b[a]);return b.join("/")}function zc(b,a,c){b=ta(b,c);a.$$protocol= 84 | b.protocol;a.$$host=b.hostname;a.$$port=Z(b.port)||xe[b.protocol]||null}function Ac(b,a,c){var d="/"!==b.charAt(0);d&&(b="/"+b);b=ta(b,c);a.$$path=decodeURIComponent(d&&"/"===b.pathname.charAt(0)?b.pathname.substring(1):b.pathname);a.$$search=bc(b.search);a.$$hash=decodeURIComponent(b.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function pa(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function ab(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Nb(b){return b.substr(0, 85 | ab(b).lastIndexOf("/")+1)}function Bc(b,a){this.$$html5=!0;a=a||"";var c=Nb(b);zc(b,this,b);this.$$parse=function(a){var e=pa(c,a);if(!y(e))throw Ob("ipthprfx",a,c);Ac(e,this,b);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Ab(this.$$search),b=this.$$hash?"#"+hb(this.$$hash):"";this.$$url=Mb(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$rewrite=function(d){var e;if((e=pa(b,d))!==s)return d=e,(e=pa(a,e))!==s?c+(pa("/",e)||e):b+d;if((e=pa(c, 86 | d))!==s)return c+e;if(c==d+"/")return c}}function Pb(b,a){var c=Nb(b);zc(b,this,b);this.$$parse=function(d){var e=pa(b,d)||pa(c,d),e="#"==e.charAt(0)?pa(a,e):this.$$html5?e:"";if(!y(e))throw Ob("ihshprfx",d,a);Ac(e,this,b);d=this.$$path;var g=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));g.exec(e)||(d=(e=g.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Ab(this.$$search),e=this.$$hash?"#"+hb(this.$$hash):"";this.$$url=Mb(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl= 87 | b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(ab(b)==ab(a))return a}}function Qb(b,a){this.$$html5=!0;Pb.apply(this,arguments);var c=Nb(b);this.$$rewrite=function(d){var e;if(b==ab(d))return d;if(e=pa(c,d))return b+a+e;if(c===d+"/")return c};this.$$compose=function(){var c=Ab(this.$$search),e=this.$$hash?"#"+hb(this.$$hash):"";this.$$url=Mb(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function qb(b){return function(){return this[b]}}function Cc(b,a){return function(c){if(F(c))return this[b]; 88 | this[b]=a(c);this.$$compose();return this}}function Wd(){var b="",a=!1;this.hashPrefix=function(a){return B(a)?(b=a,this):b};this.html5Mode=function(b){return B(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,g){function f(a){c.$broadcast("$locationChangeSuccess",k.absUrl(),a)}var k,m,h=d.baseHref(),l=d.url(),p;a?(p=l.substring(0,l.indexOf("/",l.indexOf("//")+2))+(h||"/"),m=e.history?Bc:Qb):(p=ab(l),m=Pb);k=new m(p,"#"+b);k.$$parse(k.$$rewrite(l));g.on("click", 89 | function(a){if(!a.ctrlKey&&!a.metaKey&&2!=a.which){for(var e=x(a.target);"a"!==I(e[0].nodeName);)if(e[0]===g[0]||!(e=e.parent())[0])return;var f=e.prop("href");T(f)&&"[object SVGAnimatedString]"===f.toString()&&(f=ta(f.animVal).href);if(m===Qb){var h=e.attr("href")||e.attr("xlink:href");if(0>h.indexOf("://"))if(f="#"+b,"/"==h[0])f=p+f+h;else if("#"==h[0])f=p+f+(k.path()||"/")+h;else{for(var l=k.path().split("/"),h=h.split("/"),n=0;ne?Dc(d[0],d[1],d[2],d[3],d[4],c,a):function(b,g){var f=0,k;do k=Dc(d[f++],d[f++],d[f++],d[f++],d[f++],c,a)(b,g),g=s,b=k;while(fa)for(b in h++,e)e.hasOwnProperty(b)&& 108 | !d.hasOwnProperty(b)&&(q--,delete e[b])}else e!==d&&(e=d,h++);return h},function(){p?(p=!1,b(d,d,c)):b(d,f,c);if(k)if(T(d))if(db(d)){f=Array(d.length);for(var a=0;as&&(x=4-s,M[x]||(M[x]=[]),C=O(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,C+="; newVal: "+sa(g)+"; oldVal: "+sa(f),M[x].push(C));else if(d===c){z=!1;break a}}catch(B){n.$$phase=null,e(B)}if(!(k=N.$$childHead||N!==this&&N.$$nextSibling))for(;N!==this&&!(k=N.$$nextSibling);)N=N.$parent}while(N=k);if((z|| 110 | h.length)&&!s--)throw n.$$phase=null,a("infdig",b,sa(M));}while(z||h.length);for(n.$$phase=null;l.length;)try{l.shift()()}catch(v){e(v)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this!==n&&(q(this.$$listenerCount,zb(null,l,this)),a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&& 111 | (this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=null,this.$$listeners={},this.$$watchers=this.$$asyncQueue=this.$$postDigestQueue=[],this.$destroy=this.$digest=this.$apply=A,this.$on=this.$watch=function(){return A})}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a){n.$$phase||n.$$asyncQueue.length||f.defer(function(){n.$$asyncQueue.length&&n.$digest()});this.$$asyncQueue.push({scope:this, 112 | expression:a})},$$postDigest:function(a){this.$$postDigestQueue.push(a)},$apply:function(a){try{return m("$apply"),this.$eval(a)}catch(b){e(b)}finally{n.$$phase=null;try{n.$digest()}catch(c){throw e(c),c;}}},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){c[Pa(c,b)]=null;l(e,1,a)}},$emit:function(a,b){var c=[],d,g=this,f=!1,k={name:a, 113 | targetScope:g,stopPropagation:function(){f=!0},preventDefault:function(){k.defaultPrevented=!0},defaultPrevented:!1},h=[k].concat(za.call(arguments,1)),m,l;do{d=g.$$listeners[a]||c;k.currentScope=g;m=0;for(l=d.length;mc.msieDocumentMode)throw va("iequirks");var e=ka(fa);e.isEnabled=function(){return b};e.trustAs=d.trustAs;e.getTrusted=d.getTrusted;e.valueOf=d.valueOf;b||(e.trustAs=e.getTrusted=function(a,b){return b},e.valueOf=Fa);e.parseAs=function(b,c){var d=a(c);return d.literal&&d.constant?d:function(a,c){return e.getTrusted(b,d(a,c))}};var g=e.parseAs,f=e.getTrusted,k=e.trustAs;q(fa,function(a,b){var c=I(b);e[Wa("parse_as_"+c)]= 120 | function(b){return g(a,b)};e[Wa("get_trusted_"+c)]=function(b){return f(a,b)};e[Wa("trust_as_"+c)]=function(b){return k(a,b)}});return e}]}function ce(){this.$get=["$window","$document",function(b,a){var c={},d=Z((/android (\d+)/.exec(I((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),g=a[0]||{},f=g.documentMode,k,m=/^(Moz|webkit|O|ms)(?=[A-Z])/,h=g.body&&g.body.style,l=!1,p=!1;if(h){for(var n in h)if(l=m.exec(n)){k=l[0];k=k.substr(0,1).toUpperCase()+k.substr(1); 121 | break}k||(k="WebkitOpacity"in h&&"webkit");l=!!("transition"in h||k+"Transition"in h);p=!!("animation"in h||k+"Animation"in h);!d||l&&p||(l=y(g.body.style.webkitTransition),p=y(g.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hashchange:"onhashchange"in b&&(!f||7b;b=Math.abs(b);var f=b+"",k="",m=[],h=!1;if(-1!==f.indexOf("e")){var l=f.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&l[3]>e+1?(f="0",b=0):(k=f,h=!0)}if(h)0b)&&(k=b.toFixed(e));else{f=(f.split(Nc)[1]||"").length;F(e)&&(e=Math.min(Math.max(a.minFrac,f),a.maxFrac)); 128 | b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);b=(""+b).split(Nc);f=b[0];b=b[1]||"";var l=0,p=a.lgSize,n=a.gSize;if(f.length>=p+n)for(l=f.length-p,h=0;hb&&(d="-",b=-b);for(b=""+b;b.length-c)e+=c;0===e&&-12==c&&(e=12);return Tb(e,a,d)}}function sb(b,a){return function(c,d){var e=c["get"+b](),g=Ha(a?"SHORT"+b:b);return d[g][e]}}function Jc(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var g=0,f=0,k=b[8]?a.setUTCFullYear:a.setFullYear,m=b[8]?a.setUTCHours:a.setHours;b[9]&&(g=Z(b[9]+b[10]),f=Z(b[9]+b[11]));k.call(a,Z(b[1]),Z(b[2])-1,Z(b[3]));g=Z(b[4]||0)-g;f=Z(b[5]||0)- 130 | f;k=Z(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));m.call(a,g,f,k,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",f=[],k,m;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;y(c)&&(c=Fe.test(c)?Z(c):a(c));yb(c)&&(c=new Date(c));if(!Oa(c))return c;for(;e;)(m=Ge.exec(e))?(f=f.concat(za.call(m,1)),e=f.pop()):(f.push(e),e=null);q(f,function(a){k=He[a];g+=k?k(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g, 131 | "").replace(/''/g,"'")});return g}}function Be(){return function(b){return sa(b,!0)}}function Ce(){return function(b,a){if(!L(b)&&!y(b))return b;a=Infinity===Math.abs(Number(a))?Number(a):Z(a);if(y(b))return a?0<=a?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);0a||37<=a&&40>=a)||n()});if(e.hasEvent("paste"))a.on("paste cut",n)}a.on("change",l);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)};var r=c.ngPattern;r&&((e=r.match(/^\/(.*)\/([gim]*)$/))?(r=RegExp(e[1],e[2]),e=function(a){return ra(d,"pattern",d.$isEmpty(a)||r.test(a),a)}):e=function(c){var e=b.$eval(r);if(!e||!e.test)throw v("ngPattern")("noregexp",r,e,ga(a));return ra(d,"pattern",d.$isEmpty(c)||e.test(c),c)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var t= 138 | Z(c.ngMinlength);e=function(a){return ra(d,"minlength",d.$isEmpty(a)||a.length>=t,a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var q=Z(c.ngMaxlength);e=function(a){return ra(d,"maxlength",d.$isEmpty(a)||a.length<=q,a)};d.$parsers.push(e);d.$formatters.push(e)}}function Ub(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;dP?function(b){b=b.nodeName?b:b[0];return b.scopeName&& 142 | "HTML"!=b.scopeName?Ha(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var Yc=/[A-Z]/g,ad={full:"1.2.20",major:1,minor:2,dot:20,codeName:"accidental-beautification"};R.expando="ng339";var Ya=R.cache={},ne=1,pb=S.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},Xa=S.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)};R._data= 143 | function(b){return this.cache[b[this.expando]]||{}};var ie=/([\:\-\_]+(.))/g,je=/^moz([A-Z])/,Fb=v("jqLite"),ke=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Gb=/<|&#?\w+;/,le=/<([\w:]+)/,me=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]}; 144 | ba.optgroup=ba.option;ba.tbody=ba.tfoot=ba.colgroup=ba.caption=ba.thead;ba.th=ba.td;var Ka=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===U.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(S).on("load",a))},toString:function(){var b=[];q(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?x(this[b]):x(this[this.length+b])},length:0,push:Ke,sort:[].sort,splice:[].splice},mb={};q("multiple selected checked disabled readOnly required open".split(" "), 145 | function(b){mb[I(b)]=b});var qc={};q("input select option textarea button form details".split(" "),function(b){qc[Ha(b)]=!0});q({data:mc,inheritedData:lb,scope:function(b){return x(b).data("$scope")||lb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return x(b).data("$isolateScope")||x(b).data("$isolateScopeNoTemplate")},controller:nc,injector:function(b){return lb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Jb,css:function(b,a,c){a=Wa(a);if(B(c))b.style[a]= 146 | c;else{var d;8>=P&&(d=b.currentStyle&&b.currentStyle[a],""===d&&(d="auto"));d=d||b.style[a];8>=P&&(d=""===d?s:d);return d}},attr:function(b,a,c){var d=I(a);if(mb[d])if(B(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||A).specified?d:s;else if(B(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?s:b},prop:function(b,a,c){if(B(c))b[a]=c;else return b[a]},text:function(){function b(b,d){var e=a[b.nodeType]; 147 | if(F(d))return e?b[e]:"";b[e]=d}var a=[];9>P?(a[1]="innerText",a[3]="nodeValue"):a[1]=a[3]="textContent";b.$dv="";return b}(),val:function(b,a){if(F(a)){if("SELECT"===La(b)&&b.multiple){var c=[];q(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(F(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a, 159 | c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Pe={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Sb=function(a){this.options=a};Sb.prototype={constructor:Sb,lex:function(a){this.text=a;this.index=0;this.ch= 160 | s;this.lastCh=":";for(this.tokens=[];this.index=a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=B(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw ia("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index","<=",">="))a=this.binaryFn(a,c.fn,this.relational());return a},additive:function(){for(var a=this.multiplicative(), 173 | c;c=this.expect("+","-");)a=this.binaryFn(a,c.fn,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.fn,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(bb.ZERO,a.fn,this.unary()):(a=this.expect("!"))?this.unaryFn(a.fn,this.unary()):this.primary()},fieldAccess:function(a){var c=this,d=this.expect().text,e=Ec(d,this.options,this.text);return E(function(c, 174 | d,k){return e(k||a(c,d))},{assign:function(e,f,k){return rb(a(e,k),d,f,c.text,c.options)}})},objectIndex:function(a){var c=this,d=this.expression();this.consume("]");return E(function(e,g){var f=a(e,g),k=d(e,g),m;qa(k,c.text);if(!f)return s;(f=Ma(f[k],c.text))&&(f.then&&c.options.unwrapPromises)&&(m=f,"$$v"in f||(m.$$v=s,m.then(function(a){m.$$v=a})),f=f.$$v);return f},{assign:function(e,g,f){var k=d(e,f);return Ma(a(e,f),c.text)[k]=g}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression()); 175 | while(this.expect(","))}this.consume(")");var e=this;return function(g,f){for(var k=[],m=c?c(g,f):g,h=0;ha.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Tb(Math[0=P&&(c.href||c.name||c.$set("href", 179 | ""),a.append(U.createComment("IE fix")));if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var g="[object SVGAnimatedString]"===xa.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(g)||a.preventDefault()})}}}),Db={};q(mb,function(a,c){if("multiple"!=a){var d=ma("ng-"+c);Db[d]=function(){return{priority:100,link:function(a,g,f){a.$watch(f[d],function(a){f.$set(c,!!a)})}}}}});q(["src","srcset","href"],function(a){var c=ma("ng-"+a);Db[c]=function(){return{priority:99,link:function(d, 180 | e,g){var f=a,k=a;"href"===a&&"[object SVGAnimatedString]"===xa.call(e.prop("href"))&&(k="xlinkHref",g.$attr[k]="xlink:href",f=null);g.$observe(c,function(a){a&&(g.$set(k,a),P&&f&&e.prop(f,g[k]))})}}}});var vb={$addControl:A,$removeControl:A,$setValidity:A,$setDirty:A,$setPristine:A};Oc.$inject=["$element","$attrs","$scope","$animate"];var Rc=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:Oc,compile:function(){return{pre:function(a,e,g,f){if(!g.action){var k= 181 | function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};pb(e[0],"submit",k);e.on("$destroy",function(){c(function(){Xa(e[0],"submit",k)},0,!1)})}var m=e.parent().controller("form"),h=g.name||g.ngForm;h&&rb(a,h,f,h);if(m)e.on("$destroy",function(){m.$removeControl(f);h&&rb(a,h,s,h);E(f,vb)})}}}}}]},ed=Rc(),rd=Rc(!0),Qe=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Re=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i, 182 | Se=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Sc={text:xb,number:function(a,c,d,e,g,f){xb(a,c,d,e,g,f);e.$parsers.push(function(a){var c=e.$isEmpty(a);if(c||Se.test(a))return e.$setValidity("number",!0),""===a?null:c?a:parseFloat(a);e.$setValidity("number",!1);return s});Ie(e,"number",Te,null,e.$$validityState);e.$formatters.push(function(a){return e.$isEmpty(a)?"":""+a});d.min&&(a=function(a){var c=parseFloat(d.min);return ra(e,"min",e.$isEmpty(a)||a>=c,a)},e.$parsers.push(a),e.$formatters.push(a));d.max&& 183 | (a=function(a){var c=parseFloat(d.max);return ra(e,"max",e.$isEmpty(a)||a<=c,a)},e.$parsers.push(a),e.$formatters.push(a));e.$formatters.push(function(a){return ra(e,"number",e.$isEmpty(a)||yb(a),a)})},url:function(a,c,d,e,g,f){xb(a,c,d,e,g,f);a=function(a){return ra(e,"url",e.$isEmpty(a)||Qe.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,f){xb(a,c,d,e,g,f);a=function(a){return ra(e,"email",e.$isEmpty(a)||Re.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a, 184 | c,d,e){F(d.name)&&c.attr("name",eb());c.on("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,f=d.ngFalseValue;y(g)||(g=!0);y(f)||(f=!1);c.on("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return a!==g};e.$formatters.push(function(a){return a=== 185 | g});e.$parsers.push(function(a){return a?g:f})},hidden:A,button:A,submit:A,reset:A,file:A},Te=["badInput"],gc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,f){f&&(Sc[I(g.type)]||Sc.text)(d,e,g,f,c,a)}}}],ub="ng-valid",tb="ng-invalid",Na="ng-pristine",wb="ng-dirty",Ue=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate",function(a,c,d,e,g,f){function k(a,c){c=c?"-"+ib(c,"-"):"";f.removeClass(e,(a?tb:ub)+c);f.addClass(e,(a?ub:tb)+c)} 186 | this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var m=g(d.ngModel),h=m.assign;if(!h)throw v("ngModel")("nonassign",d.ngModel,ga(e));this.$render=A;this.$isEmpty=function(a){return F(a)||""===a||null===a||a!==a};var l=e.inheritedData("$formController")||vb,p=0,n=this.$error={};e.addClass(Na);k(!0);this.$setValidity=function(a,c){n[a]!==!c&&(c?(n[a]&&p--,p|| 187 | (k(!0),this.$valid=!0,this.$invalid=!1)):(k(!1),this.$invalid=!0,this.$valid=!1,p++),n[a]=!c,k(c,a),l.$setValidity(a,c,this))};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;f.removeClass(e,wb);f.addClass(e,Na)};this.$setViewValue=function(d){this.$viewValue=d;this.$pristine&&(this.$dirty=!0,this.$pristine=!1,f.removeClass(e,Na),f.addClass(e,wb),l.$setDirty());q(this.$parsers,function(a){d=a(d)});this.$modelValue!==d&&(this.$modelValue=d,h(a,d),q(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}}))}; 188 | var r=this;a.$watch(function(){var c=m(a);if(r.$modelValue!==c){var d=r.$formatters,e=d.length;for(r.$modelValue=c;e--;)c=d[e](c);r.$viewValue!==c&&(r.$viewValue=c,r.$render())}return c})}],Gd=function(){return{require:["ngModel","^?form"],controller:Ue,link:function(a,c,d,e){var g=e[0],f=e[1]||vb;f.$addControl(g);a.$on("$destroy",function(){f.$removeControl(g)})}}},Id=$({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),hc=function(){return{require:"?ngModel", 189 | link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&e.$isEmpty(a))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);d.$observe("required",function(){g(e.$viewValue)})}}}},Hd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){if(!F(a)){var c=[];a&&q(a.split(g),function(a){a&&c.push(aa(a))});return c}});e.$formatters.push(function(a){return L(a)? 190 | a.join(", "):s});e.$isEmpty=function(a){return!a||!a.length}}}},Ve=/^(true|false|\d+)$/,Jd=function(){return{priority:100,compile:function(a,c){return Ve.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,c,g){a.$watch(g.ngValue,function(a){g.$set("value",a)})}}}},jd=wa({compile:function(a){a.addClass("ng-binding");return function(a,d,e){d.data("$binding",e.ngBind);a.$watch(e.ngBind,function(a){d.text(a==s?"":a)})}}}),ld=["$interpolate",function(a){return function(c,d, 191 | e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],kd=["$sce","$parse",function(a,c){return function(d,e,g){e.addClass("ng-binding").data("$binding",g.ngBindHtml);var f=c(g.ngBindHtml);d.$watch(function(){return(f(d)||"").toString()},function(c){e.html(a.getTrustedHtml(f(d))||"")})}}],md=Ub("",!0),od=Ub("Odd",0),nd=Ub("Even",1),pd=wa({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),qd=[function(){return{scope:!0, 192 | controller:"@",priority:500}}],ic={};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=ma("ng-"+a);ic[c]=["$parse",function(d){return{compile:function(e,g){var f=d(g[c]);return function(c,d){d.on(I(a),function(a){c.$apply(function(){f(c,{$event:a})})})}}}}]});var td=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c, 193 | d,e,g,f){var k,m,h;c.$watch(e.ngIf,function(g){Sa(g)?m||(m=c.$new(),f(m,function(c){c[c.length++]=U.createComment(" end ngIf: "+e.ngIf+" ");k={clone:c};a.enter(c,d.parent(),d)})):(h&&(h.remove(),h=null),m&&(m.$destroy(),m=null),k&&(h=Cb(k.clone),a.leave(h,function(){h=null}),k=null))})}}}],ud=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,c,d,e,g){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ta.noop,compile:function(f,k){var m=k.ngInclude|| 194 | k.src,h=k.onload||"",l=k.autoscroll;return function(f,k,q,t,J){var w=0,u,x,s,z=function(){x&&(x.remove(),x=null);u&&(u.$destroy(),u=null);s&&(e.leave(s,function(){x=null}),x=s,s=null)};f.$watch(g.parseAsResourceUrl(m),function(g){var m=function(){!B(l)||l&&!f.$eval(l)||d()},q=++w;g?(a.get(g,{cache:c}).success(function(a){if(q===w){var c=f.$new();t.template=a;a=J(c,function(a){z();e.enter(a,null,k,m)});u=c;s=a;u.$emit("$includeContentLoaded");f.$eval(h)}}).error(function(){q===w&&z()}),f.$emit("$includeContentRequested")): 195 | (z(),t.template=null)})}}}}],Kd=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,g){d.html(g.template);a(d.contents())(c)}}}],vd=wa({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),wd=wa({terminal:!0,priority:1E3}),xd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,f){var k=f.count,m=f.$attr.when&&g.attr(f.$attr.when),h=f.offset||0,l=e.$eval(m)||{},p={},n=c.startSymbol(), 196 | r=c.endSymbol(),t=/^when(Minus)?(.+)$/;q(f,function(a,c){t.test(c)&&(l[I(c.replace("when","").replace("Minus","-"))]=g.attr(f.$attr[c]))});q(l,function(a,e){p[e]=c(a.replace(d,n+k+"-"+h+r))});e.$watch(function(){var c=parseFloat(e.$eval(k));if(isNaN(c))return"";c in l||(c=a.pluralCat(c-h));return p[c](e,g,!0)},function(a){g.text(a)})}}}],yd=["$parse","$animate",function(a,c){var d=v("ngRepeat");return{transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,link:function(e,g,f,k,m){var h=f.ngRepeat, 197 | l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),p,n,r,t,s,w,u={$id:Ja};if(!l)throw d("iexp",h);f=l[1];k=l[2];(l=l[3])?(p=a(l),n=function(a,c,d){w&&(u[w]=a);u[s]=c;u.$index=d;return p(e,u)}):(r=function(a,c){return Ja(c)},t=function(a){return a});l=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",f);s=l[3]||l[1];w=l[2];var B={};e.$watchCollection(k,function(a){var f,k,l=g[0],p,u={},C,D,H,v,y,A,F=[];if(db(a))y=a,p=n||r;else{p=n||t;y=[]; 198 | for(H in a)a.hasOwnProperty(H)&&"$"!=H.charAt(0)&&y.push(H);y.sort()}C=y.length;k=F.length=y.length;for(f=0;fC;)z.pop().element.remove()}for(;y.length>Q;)y.pop()[0].element.remove()}var h;if(!(h=t.match(d)))throw We("iexp",t,ga(f));var l=c(h[2]||h[1]),m=h[4]||h[6],n=h[5],p=c(h[3]||""),q=c(h[2]?h[1]:m),x=c(h[7]), 209 | w=h[8]?c(h[8]):null,y=[[{element:f,label:""}]];v&&(a(v)(e),v.removeClass("ng-scope"),v.remove());f.empty();f.on("change",function(){e.$apply(function(){var a,c=x(e)||[],d={},h,k,l,p,t,u,v;if(r)for(k=[],p=0,u=y.length;p@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}'); 213 | //# sourceMappingURL=angular.min.js.map 214 | --------------------------------------------------------------------------------