diff options
Diffstat (limited to 'src/ngRoute/routeParams.js')
| -rw-r--r-- | src/ngRoute/routeParams.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ngRoute/routeParams.js b/src/ngRoute/routeParams.js new file mode 100644 index 00000000..0c86e89d --- /dev/null +++ b/src/ngRoute/routeParams.js @@ -0,0 +1,33 @@ +'use strict'; + +ngRouteModule.provider('$routeParams', $RouteParamsProvider); + + +/** + * @ngdoc object + * @name ngRoute.$routeParams + * @requires $route + * + * @description + * Current set of route parameters. The route parameters are a combination of the + * {@link ng.$location $location} `search()`, and `path()`. The `path` parameters + * are extracted when the {@link ngRoute.$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 = function() { return {}; }; +} |
