aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/routeParams.js
diff options
context:
space:
mode:
authorMisko Hevery2012-03-23 14:03:24 -0700
committerMisko Hevery2012-03-28 11:16:35 -0700
commit2430f52bb97fa9d682e5f028c977c5bf94c5ec38 (patch)
treee7529b741d70199f36d52090b430510bad07f233 /src/ng/routeParams.js
parent944098a4e0f753f06b40c73ca3e79991cec6c2e2 (diff)
downloadangular.js-2430f52bb97fa9d682e5f028c977c5bf94c5ec38.tar.bz2
chore(module): move files around in preparation for more modules
Diffstat (limited to 'src/ng/routeParams.js')
-rw-r--r--src/ng/routeParams.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ng/routeParams.js b/src/ng/routeParams.js
new file mode 100644
index 00000000..949bc22d
--- /dev/null
+++ b/src/ng/routeParams.js
@@ -0,0 +1,30 @@
+'use strict';
+
+/**
+ * @ngdoc object
+ * @name angular.module.ng.$routeParams
+ * @requires $route
+ *
+ * @description
+ * Current set of route parameters. The route parameters are a combination of the
+ * {@link angular.module.ng.$location $location} `search()`, and `path()`. The `path` parameters
+ * are extracted when the {@link angular.module.ng.$route $route} path is matched.
+ *
+ * In case of parameter name collision, `path` params take precedence over `search` 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>
+ */
+function $RouteParamsProvider() {
+ this.$get = valueFn({});
+}