aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIgor Minar2013-03-08 11:43:37 -0800
committerIgor Minar2013-03-08 12:01:05 -0800
commit55856565c23586ccf035824d2857ab1200316e13 (patch)
tree8aebe2b79b113c3aee094eab14cf43bf5a784f47 /src
parent13968343d4fe938edc84d39cb2d86e233f97ecda (diff)
downloadangular.js-55856565c23586ccf035824d2857ab1200316e13.tar.bz2
fix($route): make nextRoute.$route private
the `nextRoute` object available in `$routeChangeStart` handler accidentaly leaked property which pointed to the route definition currently being matched. this was done just for the internal needs of the `$route` implementation and was never documented as public api. Some confusion arouse around why the $route property was not always available on the `nextRoute` object (see #1907). The right thing for us to do is to prefix the property with $$ for now and refactor the code to remove the property completely in the future. Application developers should use the `nextRoute` object itself rather than its `$route` property. The main diff is that nextRoute inherits from the object referenced by $route. BREAKING CHANGE: in $routeChangeStart event, nextRoute.$route property is gone. Use the nextRoute object instead of nextRoute.$route. Closes #1907
Diffstat (limited to 'src')
-rw-r--r--src/ng/route.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ng/route.js b/src/ng/route.js
index 91e4adb3..e9b62bee 100644
--- a/src/ng/route.js
+++ b/src/ng/route.js
@@ -362,7 +362,7 @@ function $RouteProvider(){
var next = parseRoute(),
last = $route.current;
- if (next && last && next.$route === last.$route
+ if (next && last && next.$$route === last.$$route
&& equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) {
last.params = next.params;
copy(last.params, $routeParams);
@@ -441,7 +441,7 @@ function $RouteProvider(){
match = inherit(route, {
params: extend({}, $location.search(), params),
pathParams: params});
- match.$route = route;
+ match.$$route = route;
}
});
// No route matched; fallback to "otherwise" route