Skip to content

Commit 8d0eb5f

Browse files
committed
v1.2.27-build.496+sha.d7c084f
1 parent ba0e5c9 commit 8d0eb5f

File tree

4 files changed

+32
-64
lines changed

4 files changed

+32
-64
lines changed

angular-route.js

+19-51
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.0-build.3341+sha.7b6c1d0
2+
* @license AngularJS v1.2.27-build.496+sha.d7c084f
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -22,12 +22,12 @@
2222
*/
2323
/* global -ngRouteModule */
2424
var ngRouteModule = angular.module('ngRoute', ['ng']).
25-
provider('$route', $RouteProvider),
26-
$routeMinErr = angular.$$minErr('ngRoute');
25+
provider('$route', $RouteProvider);
2726

2827
/**
2928
* @ngdoc provider
3029
* @name $routeProvider
30+
* @kind function
3131
*
3232
* @description
3333
*
@@ -216,14 +216,10 @@ function $RouteProvider(){
216216
* Sets route definition that will be used on route change when no other route definition
217217
* is matched.
218218
*
219-
* @param {Object|string} params Mapping information to be assigned to `$route.current`.
220-
* If called with a string, the value maps to `redirectTo`.
219+
* @param {Object} params Mapping information to be assigned to `$route.current`.
221220
* @returns {Object} self
222221
*/
223222
this.otherwise = function(params) {
224-
if (typeof params === 'string') {
225-
params = {redirectTo: params};
226-
}
227223
this.when(null, params);
228224
return this;
229225
};
@@ -234,9 +230,10 @@ function $RouteProvider(){
234230
'$routeParams',
235231
'$q',
236232
'$injector',
237-
'$templateRequest',
233+
'$http',
234+
'$templateCache',
238235
'$sce',
239-
function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {
236+
function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache, $sce) {
240237

241238
/**
242239
* @ngdoc service
@@ -441,36 +438,6 @@ function $RouteProvider(){
441438
reload: function() {
442439
forceReload = true;
443440
$rootScope.$evalAsync(updateRoute);
444-
},
445-
446-
/**
447-
* @ngdoc method
448-
* @name $route#updateParams
449-
*
450-
* @description
451-
* Causes `$route` service to update the current URL, replacing
452-
* current route parameters with those specified in `newParams`.
453-
* Provided property names that match the route's path segment
454-
* definitions will be interpolated into the location's path, while
455-
* remaining properties will be treated as query params.
456-
*
457-
* @param {Object} newParams mapping of URL parameter names to values
458-
*/
459-
updateParams: function(newParams) {
460-
if (this.current && this.current.$$route) {
461-
var searchParams = {}, self=this;
462-
463-
angular.forEach(Object.keys(newParams), function(key) {
464-
if (!self.current.pathParams[key]) searchParams[key] = newParams[key];
465-
});
466-
467-
newParams = angular.extend({}, this.current.params, newParams);
468-
$location.path(interpolate(this.current.$$route.originalPath, newParams));
469-
$location.search(angular.extend({}, $location.search(), searchParams));
470-
}
471-
else {
472-
throw $routeMinErr('norout', 'Tried updating route when with no current route');
473-
}
474441
}
475442
};
476443

@@ -546,7 +513,7 @@ function $RouteProvider(){
546513

547514
angular.forEach(locals, function(value, key) {
548515
locals[key] = angular.isString(value) ?
549-
$injector.get(value) : $injector.invoke(value, null, null, key);
516+
$injector.get(value) : $injector.invoke(value);
550517
});
551518

552519
if (angular.isDefined(template = next.template)) {
@@ -560,7 +527,8 @@ function $RouteProvider(){
560527
templateUrl = $sce.getTrustedResourceUrl(templateUrl);
561528
if (angular.isDefined(templateUrl)) {
562529
next.loadedTemplateUrl = templateUrl;
563-
template = $templateRequest(templateUrl);
530+
template = $http.get(templateUrl, {cache: $templateCache}).
531+
then(function(response) { return response.data; });
564532
}
565533
}
566534
if (angular.isDefined(template)) {
@@ -722,6 +690,7 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
722690
<pre>$location.path() = {{main.$location.path()}}</pre>
723691
<pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
724692
<pre>$route.current.params = {{main.$route.current.params}}</pre>
693+
<pre>$route.current.scope.name = {{main.$route.current.scope.name}}</pre>
725694
<pre>$routeParams = {{main.$routeParams}}</pre>
726695
</div>
727696
</file>
@@ -854,28 +823,27 @@ function ngViewFactory( $route, $anchorScroll, $animate) {
854823
link: function(scope, $element, attr, ctrl, $transclude) {
855824
var currentScope,
856825
currentElement,
857-
previousLeaveAnimation,
826+
previousElement,
858827
autoScrollExp = attr.autoscroll,
859828
onloadExp = attr.onload || '';
860829

861830
scope.$on('$routeChangeSuccess', update);
862831
update();
863832

864833
function cleanupLastView() {
865-
if(previousLeaveAnimation) {
866-
$animate.cancel(previousLeaveAnimation);
867-
previousLeaveAnimation = null;
834+
if(previousElement) {
835+
previousElement.remove();
836+
previousElement = null;
868837
}
869-
870838
if(currentScope) {
871839
currentScope.$destroy();
872840
currentScope = null;
873841
}
874842
if(currentElement) {
875-
previousLeaveAnimation = $animate.leave(currentElement);
876-
previousLeaveAnimation.then(function() {
877-
previousLeaveAnimation = null;
843+
$animate.leave(currentElement, function() {
844+
previousElement = null;
878845
});
846+
previousElement = currentElement;
879847
currentElement = null;
880848
}
881849
}
@@ -895,7 +863,7 @@ function ngViewFactory( $route, $anchorScroll, $animate) {
895863
// function is called before linking the content, which would apply child
896864
// directives to non existing elements.
897865
var clone = $transclude(newScope, function(clone) {
898-
$animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter () {
866+
$animate.enter(clone, null, currentElement || $element, function onNgViewEnter () {
899867
if (angular.isDefined(autoScrollExp)
900868
&& (!autoScrollExp || scope.$eval(autoScrollExp))) {
901869
$anchorScroll();

angular-route.min.js

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)