aboutsummaryrefslogtreecommitdiffstats
path: root/src/service/routeParams.js
diff options
context:
space:
mode:
authorMisko Hevery2011-08-23 22:30:14 -0700
committerIgor Minar2011-08-31 14:31:23 -0700
commitad3cc16eef0a13844e6e05abcb18c46a370f0814 (patch)
tree48c90bd555d26eef0164b7deeff5417e300a6536 /src/service/routeParams.js
parent08d09ecbaa07564bf3cf6a62e0be4c41b355d23b (diff)
downloadangular.js-ad3cc16eef0a13844e6e05abcb18c46a370f0814.tar.bz2
feat($route): add events before/after route change
BREAKING CHANGE * removing `onChange` FEATURE * adding three events: $beforeRouteChange, $afterRouteChange, $routeReload
Diffstat (limited to 'src/service/routeParams.js')
-rw-r--r--src/service/routeParams.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/service/routeParams.js b/src/service/routeParams.js
new file mode 100644
index 00000000..8a69903f
--- /dev/null
+++ b/src/service/routeParams.js
@@ -0,0 +1,31 @@
+'use strict';
+
+/**
+ * @workInProgress
+ * @ngdoc service
+ * @name angular.service.$routeParams
+ * @requires $route
+ *
+ * @description
+ * Current set of route parameters. The route parameters are a combination of the
+ * {@link angular.service.$location $location} `hashSearch`, and `path`. The `path` parameters
+ * are extracted when the {@link angular.service.$route $route} path is matched.
+ *
+ * In case of parameter name collision, `path` params take precedence over `hashSearch` params.
+ *
+ * The service guarantees that the identity of the `$routeParams` object will remain unchanged
+ * (but its properties will likely change) even when a route change occurs.
+ *
+ * @example
+ * <pre>
+ * // Given:
+ * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
+ * // Route: /Chapter/:chapterId/Section/:sectionId
+ * //
+ * // Then
+ * $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
+ * </pre>
+ */
+angularService('$routeParams', function(){
+ return {};
+});