angularjs-rails 1.5.5 → 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 895ca6a972b4db80f33f25c4e63bb46a0b26432a
4
- data.tar.gz: 3483320ceca41adcb1e22f2d1c3b9dcc47bc73aa
3
+ metadata.gz: 4fd8e2e16b8ebda15c495c475a65babe97a3ca80
4
+ data.tar.gz: b60430a0cf9ce45eee59dcc1221e4aa262bb251d
5
5
  SHA512:
6
- metadata.gz: 8c023b142da5d9614c78886daffe753b5a0109ad9666ef7ab86cb3ffb14cfb5fc2918d0cd583eb1473fad8dcf9ca5c93d6cc4df350cae543386f625cc8157774
7
- data.tar.gz: 53eb5be5f352da05f7fa7dad196d77546c19c1a878af64eb041d161a62ec81da9cae52c83c5258dd32d3716a61d988247b2b596a95b8d6130e891fbcb070b25e
6
+ metadata.gz: 7e6d584b32cc754efce07c4d98c05339ab63711d2555a0e3e7d0fb7980755810d457911993bf23bcca343bcdaf7475c6278b7df5cda3742f095178196aa4d87a
7
+ data.tar.gz: e8f6d1cf263c659e0a3e307cef9219f31297060e1fca9f3a4d354d6b349d90e6c93fa5a71f92490dd722733007ad87d6593279b9507a3623b0edae9de7dc887f
@@ -1,6 +1,6 @@
1
1
  module AngularJS
2
2
  module Rails
3
- VERSION = "1.5.5"
3
+ VERSION = "1.5.6"
4
4
  UNSTABLE_VERSION = "2.0.0-beta.17"
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -132,7 +132,7 @@ function stripCommentsFromElement(element) {
132
132
  if (element instanceof jqLite) {
133
133
  switch (element.length) {
134
134
  case 0:
135
- return [];
135
+ return element;
136
136
  break;
137
137
 
138
138
  case 1:
@@ -3243,7 +3243,8 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
3243
3243
  }
3244
3244
 
3245
3245
  function update(element) {
3246
- getRunner(element).setHost(newRunner);
3246
+ var runner = getRunner(element);
3247
+ if (runner) runner.setHost(newRunner);
3247
3248
  }
3248
3249
  }
3249
3250
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -32,7 +32,7 @@
32
32
  * | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled |
33
33
  * | {@link ng.directive:ngRequired ngRequired} | aria-required
34
34
  * | {@link ng.directive:ngChecked ngChecked} | aria-checked
35
- * | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly ||
35
+ * | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly |
36
36
  * | {@link ng.directive:ngValue ngValue} | aria-checked |
37
37
  * | {@link ng.directive:ngShow ngShow} | aria-hidden |
38
38
  * | {@link ng.directive:ngHide ngHide} | aria-hidden |
@@ -43,7 +43,7 @@
43
43
  * Find out more information about each directive by reading the
44
44
  * {@link guide/accessibility ngAria Developer Guide}.
45
45
  *
46
- * ##Example
46
+ * ## Example
47
47
  * Using ngDisabled with ngAria:
48
48
  * ```html
49
49
  * <md-checkbox ng-disabled="disabled">
@@ -53,7 +53,7 @@
53
53
  * <md-checkbox ng-disabled="disabled" aria-disabled="true">
54
54
  * ```
55
55
  *
56
- * ##Disabling Attributes
56
+ * ## Disabling Attributes
57
57
  * It's possible to disable individual attributes added by ngAria with the
58
58
  * {@link ngAria.$ariaProvider#config config} method. For more details, see the
59
59
  * {@link guide/accessibility Developer Guide}.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -87,7 +87,7 @@ function minErr(module, ErrorConstructor) {
87
87
  return match;
88
88
  });
89
89
 
90
- message += '\nhttp://errors.angularjs.org/1.5.5/' +
90
+ message += '\nhttp://errors.angularjs.org/1.5.6/' +
91
91
  (module ? module + '/' : '') + code;
92
92
 
93
93
  for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -555,6 +555,8 @@ angular.module('ngMessages', [])
555
555
  link: function($scope, element, attrs) {
556
556
  var src = attrs.ngMessagesInclude || attrs.src;
557
557
  $templateRequest(src).then(function(html) {
558
+ if ($scope.$$destroyed) return;
559
+
558
560
  $compile(html)($scope, function(contents) {
559
561
  element.after(contents);
560
562
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -13,6 +13,7 @@
13
13
  * @description
14
14
  *
15
15
  * Namespace from 'angular-mocks.js' which contains testing related code.
16
+ *
16
17
  */
17
18
  angular.mock = {};
18
19
 
@@ -24,7 +25,7 @@ angular.mock = {};
24
25
  * @description
25
26
  * This service is a mock implementation of {@link ng.$browser}. It provides fake
26
27
  * implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr,
27
- * cookies, etc...
28
+ * cookies, etc.
28
29
  *
29
30
  * The api of this service is the same as that of the real {@link ng.$browser $browser}, except
30
31
  * that there are several helper methods available which can be used in tests.
@@ -226,13 +227,13 @@ angular.mock.$ExceptionHandlerProvider = function() {
226
227
  * @param {string} mode Mode of operation, defaults to `rethrow`.
227
228
  *
228
229
  * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`
229
- * mode stores an array of errors in `$exceptionHandler.errors`, to allow later
230
- * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
231
- * {@link ngMock.$log#reset reset()}
230
+ * mode stores an array of errors in `$exceptionHandler.errors`, to allow later assertion of
231
+ * them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
232
+ * {@link ngMock.$log#reset reset()}.
232
233
  * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
233
- * is a bug in the application or test, so this mock will make these tests fail.
234
- * For any implementations that expect exceptions to be thrown, the `rethrow` mode
235
- * will also maintain a log of thrown errors.
234
+ * is a bug in the application or test, so this mock will make these tests fail. For any
235
+ * implementations that expect exceptions to be thrown, the `rethrow` mode will also maintain
236
+ * a log of thrown errors in `$exceptionHandler.errors`.
236
237
  */
237
238
  this.mode = function(mode) {
238
239
 
@@ -766,6 +767,8 @@ angular.mock.TzDate.prototype = Date.prototype;
766
767
  * @description
767
768
  * Mock implementation of the {@link ng.$animate `$animate`} service. Exposes two additional methods
768
769
  * for testing animations.
770
+ *
771
+ * You need to require the `ngAnimateMock` module in your test suite for instance `beforeEach(module('ngAnimateMock'))`
769
772
  */
770
773
  angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
771
774
 
@@ -1003,8 +1006,10 @@ angular.mock.dump = function(object) {
1003
1006
  * Fake HTTP backend implementation suitable for unit testing applications that use the
1004
1007
  * {@link ng.$http $http service}.
1005
1008
  *
1006
- * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less
1009
+ * <div class="alert alert-info">
1010
+ * **Note**: For fake HTTP backend implementation suitable for end-to-end testing or backend-less
1007
1011
  * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.
1012
+ * </div>
1008
1013
  *
1009
1014
  * During unit testing, we want our unit tests to run quickly and have no external dependencies so
1010
1015
  * we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or
@@ -1396,7 +1401,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
1396
1401
  // if $browser specified, we do auto flush all requests
1397
1402
  ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));
1398
1403
  } else if (definition.passThrough) {
1399
- $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType);
1404
+ $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers);
1400
1405
  } else throw new Error('No response defined !');
1401
1406
  return;
1402
1407
  }
@@ -1875,6 +1880,15 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
1875
1880
 
1876
1881
  function MockHttpExpectation(method, url, data, headers, keys) {
1877
1882
 
1883
+ function getUrlParams(u) {
1884
+ var params = u.slice(u.indexOf('?') + 1).split('&');
1885
+ return params.sort();
1886
+ }
1887
+
1888
+ function compareUrl(u) {
1889
+ return (url.slice(0, url.indexOf('?')) == u.slice(0, u.indexOf('?')) && getUrlParams(url).join() == getUrlParams(u).join());
1890
+ }
1891
+
1878
1892
  this.data = data;
1879
1893
  this.headers = headers;
1880
1894
 
@@ -1890,7 +1904,7 @@ function MockHttpExpectation(method, url, data, headers, keys) {
1890
1904
  if (!url) return true;
1891
1905
  if (angular.isFunction(url.test)) return url.test(u);
1892
1906
  if (angular.isFunction(url)) return url(u);
1893
- return url == u;
1907
+ return (url == u || compareUrl(u));
1894
1908
  };
1895
1909
 
1896
1910
  this.matchHeaders = function(h) {
@@ -2255,6 +2269,34 @@ angular.mock.$ComponentControllerProvider = ['$compileProvider', function($compi
2255
2269
  *
2256
2270
  * <div doc-module-components="ngMock"></div>
2257
2271
  *
2272
+ * @installation
2273
+ *
2274
+ * First, download the file:
2275
+ * * [Google CDN](https://developers.google.com/speed/libraries/devguide#angularjs) e.g.
2276
+ * `"//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-mocks.js"`
2277
+ * * [NPM](https://www.npmjs.com/) e.g. `npm install angular-mocks@X.Y.Z`
2278
+ * * [Bower](http://bower.io) e.g. `bower install angular-mocks@X.Y.Z`
2279
+ * * [code.angularjs.org](https://code.angularjs.org/) (discouraged for production use) e.g.
2280
+ * `"//code.angularjs.org/X.Y.Z/angular-mocks.js"`
2281
+ *
2282
+ * where X.Y.Z is the AngularJS version you are running.
2283
+ *
2284
+ * Then, configure your test runner to load `angular-mocks.js` after `angular.js`.
2285
+ * This example uses <a href="http://karma-runner.github.io/">Karma</a>:
2286
+ *
2287
+ * ```
2288
+ * config.set({
2289
+ * files: [
2290
+ * 'build/angular.js', // and other module files you need
2291
+ * 'build/angular-mocks.js',
2292
+ * '<path/to/application/files>',
2293
+ * '<path/to/spec/files>'
2294
+ * ]
2295
+ * });
2296
+ * ```
2297
+ *
2298
+ * Including the `angular-mocks.js` file automatically adds the `ngMock` module, so your tests
2299
+ * are ready to go!
2258
2300
  */
2259
2301
  angular.module('ngMock', ['ng']).provider({
2260
2302
  $browser: angular.mock.$BrowserProvider,
@@ -2294,8 +2336,10 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2294
2336
  * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of
2295
2337
  * applications that use the {@link ng.$http $http service}.
2296
2338
  *
2297
- * *Note*: For fake http backend implementation suitable for unit testing please see
2339
+ * <div class="alert alert-info">
2340
+ * **Note**: For fake http backend implementation suitable for unit testing please see
2298
2341
  * {@link ngMock.$httpBackend unit-testing $httpBackend mock}.
2342
+ * </div>
2299
2343
  *
2300
2344
  * This implementation can be used to respond with static or dynamic responses via the `when` api
2301
2345
  * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the
@@ -2316,9 +2360,9 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2316
2360
  * on the `ngMockE2E` and your application modules and defines the fake backend:
2317
2361
  *
2318
2362
  * ```js
2319
- * myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
2363
+ * var myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
2320
2364
  * myAppDev.run(function($httpBackend) {
2321
- * phones = [{name: 'phone1'}, {name: 'phone2'}];
2365
+ * var phones = [{name: 'phone1'}, {name: 'phone2'}];
2322
2366
  *
2323
2367
  * // returns the current list of phones
2324
2368
  * $httpBackend.whenGET('/phones').respond(phones);
@@ -2329,12 +2373,74 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2329
2373
  * phones.push(phone);
2330
2374
  * return [200, phone, {}];
2331
2375
  * });
2332
- * $httpBackend.whenGET(/^\/templates\//).passThrough();
2376
+ * $httpBackend.whenGET(/^\/templates\//).passThrough(); // Requests for templare are handled by the real server
2333
2377
  * //...
2334
2378
  * });
2335
2379
  * ```
2336
2380
  *
2337
2381
  * Afterwards, bootstrap your app with this new module.
2382
+ *
2383
+ * ## Example
2384
+ * <example name="httpbackend-e2e-testing" module="myAppE2E" deps="angular-mocks.js">
2385
+ * <file name="app.js">
2386
+ * var myApp = angular.module('myApp', []);
2387
+ *
2388
+ * myApp.controller('main', function($http) {
2389
+ * var ctrl = this;
2390
+ *
2391
+ * ctrl.phones = [];
2392
+ * ctrl.newPhone = {
2393
+ * name: ''
2394
+ * };
2395
+ *
2396
+ * ctrl.getPhones = function() {
2397
+ * $http.get('/phones').then(function(response) {
2398
+ * ctrl.phones = response.data;
2399
+ * });
2400
+ * };
2401
+ *
2402
+ * ctrl.addPhone = function(phone) {
2403
+ * $http.post('/phones', phone).then(function() {
2404
+ * ctrl.newPhone = {name: ''};
2405
+ * return ctrl.getPhones();
2406
+ * });
2407
+ * };
2408
+ *
2409
+ * ctrl.getPhones();
2410
+ * });
2411
+ * </file>
2412
+ * <file name="e2e.js">
2413
+ * var myAppDev = angular.module('myAppE2E', ['myApp', 'ngMockE2E']);
2414
+ *
2415
+ * myAppDev.run(function($httpBackend) {
2416
+ * var phones = [{name: 'phone1'}, {name: 'phone2'}];
2417
+ *
2418
+ * // returns the current list of phones
2419
+ * $httpBackend.whenGET('/phones').respond(phones);
2420
+ *
2421
+ * // adds a new phone to the phones array
2422
+ * $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
2423
+ * var phone = angular.fromJson(data);
2424
+ * phones.push(phone);
2425
+ * return [200, phone, {}];
2426
+ * });
2427
+ * });
2428
+ * </file>
2429
+ * <file name="index.html">
2430
+ * <div ng-controller="main as $ctrl">
2431
+ * <form name="newPhoneForm" ng-submit="$ctrl.addPhone($ctrl.newPhone)">
2432
+ * <input type="text" ng-model="$ctrl.newPhone.name">
2433
+ * <input type="submit" value="Add Phone">
2434
+ * </form>
2435
+ * <h1>Phones</h1>
2436
+ * <ul>
2437
+ * <li ng-repeat="phone in $ctrl.phones">{{phone.name}}</li>
2438
+ * </ul>
2439
+ * </div>
2440
+ * </file>
2441
+ * </example>
2442
+ *
2443
+ *
2338
2444
  */
2339
2445
 
2340
2446
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.5.5
2
+ * @license AngularJS v1.5.6
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -604,35 +604,7 @@ function $RouteProvider() {
604
604
  }
605
605
 
606
606
  $q.when(nextRoute).
607
- then(function() {
608
- if (nextRoute) {
609
- var locals = angular.extend({}, nextRoute.resolve),
610
- template, templateUrl;
611
-
612
- angular.forEach(locals, function(value, key) {
613
- locals[key] = angular.isString(value) ?
614
- $injector.get(value) : $injector.invoke(value, null, null, key);
615
- });
616
-
617
- if (angular.isDefined(template = nextRoute.template)) {
618
- if (angular.isFunction(template)) {
619
- template = template(nextRoute.params);
620
- }
621
- } else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) {
622
- if (angular.isFunction(templateUrl)) {
623
- templateUrl = templateUrl(nextRoute.params);
624
- }
625
- if (angular.isDefined(templateUrl)) {
626
- nextRoute.loadedTemplateUrl = $sce.valueOf(templateUrl);
627
- template = $templateRequest(templateUrl);
628
- }
629
- }
630
- if (angular.isDefined(template)) {
631
- locals['$template'] = template;
632
- }
633
- return $q.all(locals);
634
- }
635
- }).
607
+ then(resolveLocals).
636
608
  then(function(locals) {
637
609
  // after route change
638
610
  if (nextRoute == $route.current) {
@@ -650,6 +622,41 @@ function $RouteProvider() {
650
622
  }
651
623
  }
652
624
 
625
+ function resolveLocals(route) {
626
+ if (route) {
627
+ var locals = angular.extend({}, route.resolve);
628
+ angular.forEach(locals, function(value, key) {
629
+ locals[key] = angular.isString(value) ?
630
+ $injector.get(value) :
631
+ $injector.invoke(value, null, null, key);
632
+ });
633
+ var template = getTemplateFor(route);
634
+ if (angular.isDefined(template)) {
635
+ locals['$template'] = template;
636
+ }
637
+ return $q.all(locals);
638
+ }
639
+ }
640
+
641
+
642
+ function getTemplateFor(route) {
643
+ var template, templateUrl;
644
+ if (angular.isDefined(template = route.template)) {
645
+ if (angular.isFunction(template)) {
646
+ template = template(route.params);
647
+ }
648
+ } else if (angular.isDefined(templateUrl = route.templateUrl)) {
649
+ if (angular.isFunction(templateUrl)) {
650
+ templateUrl = templateUrl(route.params);
651
+ }
652
+ if (angular.isDefined(templateUrl)) {
653
+ route.loadedTemplateUrl = $sce.valueOf(templateUrl);
654
+ template = $templateRequest(templateUrl);
655
+ }
656
+ }
657
+ return template;
658
+ }
659
+
653
660
 
654
661
  /**
655
662
  * @returns {Object} the current active route, by matching it against the URL