diff options
| author | Igor Minar | 2011-01-30 15:48:40 -0800 | 
|---|---|---|
| committer | Igor Minar | 2011-02-01 09:33:58 -0800 | 
| commit | 21ad1762460487b813463008747f65fd5f3216da (patch) | |
| tree | 2be0ac660a61c54f26c15407450704d8f7565598 /src | |
| parent | df1d222dd0b4ed00e241a4b0709d2d5c0397b063 (diff) | |
| download | angular.js-21ad1762460487b813463008747f65fd5f3216da.tar.bz2 | |
fixing $route docs
Diffstat (limited to 'src')
| -rw-r--r-- | src/services.js | 17 | 
1 files changed, 9 insertions, 8 deletions
| diff --git a/src/services.js b/src/services.js index 7c4e7dfd..40f07b4d 100644 --- a/src/services.js +++ b/src/services.js @@ -611,14 +611,15 @@ function switchRouteMatcher(on, when, dstName) {   * @name angular.service.$route   * @requires $location   * - * @property {Object} current Name of the current route - * @property {Array.<Object>} routes List of configured routes + * @property {Object} current Reference to the current route definition. + * @property {Array.<Object>} routes Array of all configured routes.   *   * @description - * Watches $location.hashPath and tries to map the hash to an existing route + * Watches `$location.hashPath` and tries to map the hash to an existing route   * definition. It is used for deep-linking URLs to controllers and views (HTML partials).   * - * $route is typically used in conjunction with {@link angular.widget.ng:view ng:view} widget. + * The `$route` service is typically used in conjunction with {@link angular.widget.ng:view ng:view} + * widget.   *   * @example  <p> @@ -673,7 +674,7 @@ angularServiceInject('$route', function(location) {           * @name angular.service.$route#onChange           * @methodOf angular.service.$route           * -         * @param {function()} fn Function that will be called on route change +         * @param {function()} fn Function that will be called when `$route.current` changes.           *           * @description           * Register a handler function that will be called when route changes @@ -686,16 +687,16 @@ angularServiceInject('$route', function(location) {           * @name angular.service.$route#when           * @methodOf angular.service.$route           * -         * @param {string} path Route path (matched against $location.hash) +         * @param {string} path Route path (matched against `$location.hash`)           * @param {Object} params Mapping information to be assigned to `$route.current` on route           *    match.           * @returns {Object} route object           *           * @description -         * Add new route +         * Adds a new route definition to the `$route` service.           */          when:function (path, params) { -          if (isUndefined(path)) return routes; +          if (isUndefined(path)) return routes; //TODO(im): remove - not needed!            var route = routes[path];            if (!route) route = routes[path] = {};            if (params) extend(route, params); | 
