Skip to content

Commit 509b37e

Browse files
committed
dependency(): upgraded angularjs to 1.5.1
1 parent 9dac382 commit 509b37e

34 files changed

+1650
-3736
lines changed

bower.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
],
1515
"dependencies": {
1616
"jquery": "~2.1.4",
17-
"angular": "~1.5.0",
18-
"angular-route": "~1.5.0",
19-
"angular-mocks": "~1.5.0",
20-
"angular-sanitize": "~1.5.0",
17+
"angular": "~1.5.1",
18+
"angular-route": "~1.5.1",
19+
"angular-mocks": "~1.5.1",
20+
"angular-sanitize": "~1.5.1",
2121
"angular-bindonce": "~0.3.3"
2222
}
2323
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "angular-mocks",
3-
"version": "1.5.0-rc.0",
3+
"version": "1.5.1-build.4601+sha.c966876",
4+
"license": "MIT",
45
"main": "./angular-mocks.js",
56
"ignore": [],
67
"dependencies": {
7-
"angular": "1.5.0-rc.0"
8+
"angular": "1.5.1-build.4601+sha.c966876"
89
},
910
"homepage": "https://github.com/angular/bower-angular-mocks",
10-
"_release": "1.5.0-rc.0",
11+
"_release": "1.5.1-build.4601+sha.c966876",
1112
"_resolution": {
1213
"type": "version",
13-
"tag": "v1.5.0-rc.0",
14-
"commit": "aaa4993ea1fa4aac97953d65bcaeb5f6eda6f113"
14+
"tag": "v1.5.1-build.4601+sha.c966876",
15+
"commit": "ff7c5c2ac686293829786d26d844391e45c37c11"
1516
},
1617
"_source": "git://github.com/angular/bower-angular-mocks.git",
17-
"_target": "~1.5.0",
18+
"_target": "~1.5.1",
1819
"_originalSource": "angular-mocks"
1920
}

public/vendor/angular-mocks/angular-mocks.js

Lines changed: 132 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @license AngularJS v1.5.0-rc.0
3-
* (c) 2010-2015 Google, Inc. http://angularjs.org
2+
* @license AngularJS v1.5.1-build.4601+sha.c966876
3+
* (c) 2010-2016 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
66
(function(window, angular, undefined) {
@@ -758,6 +758,15 @@ angular.mock.TzDate = function(offset, timestamp) {
758758
angular.mock.TzDate.prototype = Date.prototype;
759759
/* jshint +W101 */
760760

761+
762+
/**
763+
* @ngdoc service
764+
* @name $animate
765+
*
766+
* @description
767+
* Mock implementation of the {@link ng.$animate `$animate`} service. Exposes two additional methods
768+
* for testing animations.
769+
*/
761770
angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
762771

763772
.config(['$provide', function($provide) {
@@ -790,9 +799,50 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
790799
return queueFn;
791800
});
792801

793-
$provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF',
802+
$provide.decorator('$$animateJs', ['$delegate', function($delegate) {
803+
var runners = [];
804+
805+
var animateJsConstructor = function() {
806+
var animator = $delegate.apply($delegate, arguments);
807+
// If no javascript animation is found, animator is undefined
808+
if (animator) {
809+
runners.push(animator);
810+
}
811+
return animator;
812+
};
813+
814+
animateJsConstructor.$closeAndFlush = function() {
815+
runners.forEach(function(runner) {
816+
runner.end();
817+
});
818+
runners = [];
819+
};
820+
821+
return animateJsConstructor;
822+
}]);
823+
824+
$provide.decorator('$animateCss', ['$delegate', function($delegate) {
825+
var runners = [];
826+
827+
var animateCssConstructor = function(element, options) {
828+
var animator = $delegate(element, options);
829+
runners.push(animator);
830+
return animator;
831+
};
832+
833+
animateCssConstructor.$closeAndFlush = function() {
834+
runners.forEach(function(runner) {
835+
runner.end();
836+
});
837+
runners = [];
838+
};
839+
840+
return animateCssConstructor;
841+
}]);
842+
843+
$provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF', '$animateCss', '$$animateJs',
794844
'$$forceReflow', '$$animateAsyncRun', '$rootScope',
795-
function($delegate, $timeout, $browser, $$rAF,
845+
function($delegate, $timeout, $browser, $$rAF, $animateCss, $$animateJs,
796846
$$forceReflow, $$animateAsyncRun, $rootScope) {
797847
var animate = {
798848
queue: [],
@@ -804,7 +854,35 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
804854
return $$forceReflow.totalReflows;
805855
},
806856
enabled: $delegate.enabled,
807-
flush: function() {
857+
/**
858+
* @ngdoc method
859+
* @name $animate#closeAndFlush
860+
* @description
861+
*
862+
* This method will close all pending animations (both {@link ngAnimate#javascript-based-animations Javascript}
863+
* and {@link ngAnimate.$animateCss CSS}) and it will also flush any remaining animation frames and/or callbacks.
864+
*/
865+
closeAndFlush: function() {
866+
// we allow the flush command to swallow the errors
867+
// because depending on whether CSS or JS animations are
868+
// used, there may not be a RAF flush. The primary flush
869+
// at the end of this function must throw an exception
870+
// because it will track if there were pending animations
871+
this.flush(true);
872+
$animateCss.$closeAndFlush();
873+
$$animateJs.$closeAndFlush();
874+
this.flush();
875+
},
876+
/**
877+
* @ngdoc method
878+
* @name $animate#flush
879+
* @description
880+
*
881+
* This method is used to flush the pending callbacks and animation frames to either start
882+
* an animation or conclude an animation. Note that this will not actually close an
883+
* actively running animation (see {@link ngMock.$animate#closeAndFlush `closeAndFlush()`} for that).
884+
*/
885+
flush: function(hideErrors) {
808886
$rootScope.$digest();
809887

810888
var doNextRun, somethingFlushed = false;
@@ -821,7 +899,7 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
821899
}
822900
} while (doNextRun);
823901

824-
if (!somethingFlushed) {
902+
if (!somethingFlushed && !hideErrors) {
825903
throw new Error('No pending animations ready to be closed or flushed');
826904
}
827905

@@ -1030,18 +1108,18 @@ angular.mock.dump = function(object) {
10301108
function MyController($scope, $http) {
10311109
var authToken;
10321110
1033-
$http.get('/auth.py').success(function(data, status, headers) {
1034-
authToken = headers('A-Token');
1035-
$scope.user = data;
1111+
$http.get('/auth.py').then(function(response) {
1112+
authToken = response.headers('A-Token');
1113+
$scope.user = response.data;
10361114
});
10371115
10381116
$scope.saveMessage = function(message) {
10391117
var headers = { 'Authorization': authToken };
10401118
$scope.status = 'Saving...';
10411119
1042-
$http.post('/add-msg.py', message, { headers: headers } ).success(function(response) {
1120+
$http.post('/add-msg.py', message, { headers: headers } ).then(function(response) {
10431121
$scope.status = '';
1044-
}).error(function() {
1122+
}).catch(function() {
10451123
$scope.status = 'Failed...';
10461124
});
10471125
};
@@ -2093,6 +2171,47 @@ angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
20932171
};
20942172
}];
20952173

2174+
/**
2175+
* @ngdoc service
2176+
* @name $componentController
2177+
* @description
2178+
* A service that can be used to create instances of component controllers.
2179+
* <div class="alert alert-info">
2180+
* Be aware that the controller will be instantiated and attached to the scope as specified in
2181+
* the component definition object. That means that you must always provide a `$scope` object
2182+
* in the `locals` param.
2183+
* </div>
2184+
* @param {string} componentName the name of the component whose controller we want to instantiate
2185+
* @param {Object} locals Injection locals for Controller.
2186+
* @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used
2187+
* to simulate the `bindToController` feature and simplify certain kinds of tests.
2188+
* @param {string=} ident Override the property name to use when attaching the controller to the scope.
2189+
* @return {Object} Instance of requested controller.
2190+
*/
2191+
angular.mock.$ComponentControllerProvider = ['$compileProvider', function($compileProvider) {
2192+
this.$get = ['$controller','$injector', function($controller,$injector) {
2193+
return function $componentController(componentName, locals, bindings, ident) {
2194+
// get all directives associated to the component name
2195+
var directives = $injector.get(componentName + 'Directive');
2196+
// look for those directives that are components
2197+
var candidateDirectives = directives.filter(function(directiveInfo) {
2198+
// components have controller, controllerAs and restrict:'E'
2199+
return directiveInfo.controller && directiveInfo.controllerAs && directiveInfo.restrict === 'E';
2200+
});
2201+
// check if valid directives found
2202+
if (candidateDirectives.length === 0) {
2203+
throw new Error('No component found');
2204+
}
2205+
if (candidateDirectives.length > 1) {
2206+
throw new Error('Too many components found');
2207+
}
2208+
// get the info of the component
2209+
var directiveInfo = candidateDirectives[0];
2210+
return $controller(directiveInfo.controller, locals, bindings, ident || directiveInfo.controllerAs);
2211+
};
2212+
}];
2213+
}];
2214+
20962215

20972216
/**
20982217
* @ngdoc module
@@ -2116,7 +2235,8 @@ angular.module('ngMock', ['ng']).provider({
21162235
$log: angular.mock.$LogProvider,
21172236
$interval: angular.mock.$IntervalProvider,
21182237
$httpBackend: angular.mock.$HttpBackendProvider,
2119-
$rootElement: angular.mock.$RootElementProvider
2238+
$rootElement: angular.mock.$RootElementProvider,
2239+
$componentController: angular.mock.$ComponentControllerProvider
21202240
}).config(['$provide', function($provide) {
21212241
$provide.decorator('$timeout', angular.mock.$TimeoutDecorator);
21222242
$provide.decorator('$$rAF', angular.mock.$RAFDecorator);
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "angular-mocks",
3-
"version": "1.5.0-rc.0",
3+
"version": "1.5.1-build.4601+sha.c966876",
4+
"license": "MIT",
45
"main": "./angular-mocks.js",
56
"ignore": [],
67
"dependencies": {
7-
"angular": "1.5.0-rc.0"
8+
"angular": "1.5.1-build.4601+sha.c966876"
89
}
910
}

public/vendor/angular-mocks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-mocks",
3-
"version": "1.5.0-rc.0",
3+
"version": "1.5.1-build.4601+sha.c966876",
44
"description": "AngularJS mocks for testing",
55
"main": "angular-mocks.js",
66
"scripts": {
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "angular-route",
3-
"version": "1.5.0-rc.0",
3+
"version": "1.5.1-build.4601+sha.c966876",
4+
"license": "MIT",
45
"main": "./angular-route.js",
56
"ignore": [],
67
"dependencies": {
7-
"angular": "1.5.0-rc.0"
8+
"angular": "1.5.1-build.4601+sha.c966876"
89
},
910
"homepage": "https://github.com/angular/bower-angular-route",
10-
"_release": "1.5.0-rc.0",
11+
"_release": "1.5.1-build.4601+sha.c966876",
1112
"_resolution": {
1213
"type": "version",
13-
"tag": "v1.5.0-rc.0",
14-
"commit": "496e2f35541957c1e4903b99622be5bcdb058a7a"
14+
"tag": "v1.5.1-build.4601+sha.c966876",
15+
"commit": "967fdabf084ac9f37c6b984d8893ebfebde5fc02"
1516
},
1617
"_source": "git://github.com/angular/bower-angular-route.git",
17-
"_target": "~1.5.0",
18+
"_target": "~1.5.1",
1819
"_originalSource": "angular-route"
1920
}

0 commit comments

Comments
 (0)