Skip to content

Commit 3f46ba4

Browse files
committed
Updated package and params
1 parent 6e26496 commit 3f46ba4

File tree

5 files changed

+61
-24
lines changed

5 files changed

+61
-24
lines changed

Gruntfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ module.exports = function(grunt) {
7777
},
7878
},
7979
api: {
80+
title: '<%= pkg.title %>',
81+
version: '<%= pkg.version %>',
8082
expand: false,
8183
src: [
8284
'src/**/*.js',

docs/api/index.ngdoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
@ngdoc overview
22
@name API Reference
3+
@area api
4+
@id api-index
35
@description
4-
56
# Angular-route-segment API Docs
7+
68
Welcome to the angular-route-segment API docs page. These pages contain the reference materials for version <strong ng-bind="version"></strong>.
79

810
## Modules

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "angular-route-segment",
3+
"title": "Angular Route Segment",
34
"version": "1.5.0",
45
"devDependencies": {
56
"dgeni-alive": "~0.0.5",

src/route-segment.js

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* @license MIT License http://opensource.org/licenses/MIT
66
*/
77
'use strict';
8-
98
(function(angular) {
109

1110
/**
1211
* @ngdoc module
1312
* @module route-segment
1413
* @name route-segment
14+
* @packageName angular-route-segment
1515
* @requires ngRoute
1616
* @description
1717
* This library is intended to provide the lacking functionality of nested routing to [AngularJS](http://angularjs.org) applications.
@@ -167,7 +167,6 @@ mod.provider( '$routeSegment',
167167
* @ngdoc type
168168
* @module route-segment
169169
* @name $routeSegmentProvider.Pointer
170-
* @protected
171170
* @description Segment traversal element.
172171
*
173172
* Each {@link $routeSegmentProvider#segment $routeSegmentProvider#segment} call creates new navigation pointer
@@ -189,26 +188,23 @@ mod.provider( '$routeSegment',
189188
/**
190189
* @ngdoc method
191190
* @name $routeSegmentProvider.Pointer#segment
192-
* @param {String} name Name of a segment.
191+
* @param {string} name Name of a segment.
193192
* @param {Object} params Segment's parameters hash. The following params are supported:
194-
* - `template` {String|Function} provides HTML for the given segment view;
195-
* - `templateUrl` {String|Function} is a template should be fetched from network via this URL;
196-
* - `controller` {String|Function} is attached to the given segment view when compiled and linked,
193+
* @param {String|Function} [params.template] provides HTML for the given segment view;
194+
* @param {String|Function} [params.templateUrl] template to fetch from network via this URL;
195+
* @param {String|Function} [params.controller] cotroller attached to the given segment view when compiled and linked,
197196
* this can be any controller definition AngularJS supports;
198-
* - `controllerAs` {String} is a controller alias name, if present the controller will be
197+
* @param {String} [params.controllerAs] controller alias name, if present the controller will be
199198
* published to scope under the controllerAs name
200-
* - `dependencies` {String[]} is an array of route param names which are forcing the view
201-
* to recreate when changed;
202-
* - `watcher` {Sunction} is a $watch-function for recreating the view when its returning value
203-
* is changed;
204-
* - `resolve` {Object<String, Function>} is a hash of functions or injectable names which should be resolved
199+
* @param {Array<String>} [params.dependencies] array of route param names which are forcing the view to recreate when changed;
200+
* @param {Function} [params.watcher] $watch-function for recreating the view when its returning value is changed;
201+
* @param {Object<String, Function>} resolve hash of functions or injectable names which should be resolved
205202
* prior to instantiating the template and the controller;
206-
* - `untilResolved` {Object} is the alternate set of params (e.g. `template` and `controller`)
203+
* @param {Object} [params.untilResolved] alternate set of params (e.g. `template` and `controller`)
207204
* which should be used before resolving is completed;
208-
* - `resolveFailed` {Object} is the alternate set of params which should be used
209-
* if resolving failed;
210-
* - `default` {Boolean} is a boolean value which can be set to true if this child segment should be
211-
* loaded by default when no child is specified in the route.
205+
* @param {Object} [params.resolveFailed] alternate set of params which should be used if resolving failed;
206+
* @param {Boolean} [params.default] when set to true this child segment should be loaded by
207+
* default when no child is specified in the route.
212208
* @returns {$routeSegmentProvider.Pointer} The same level pointer.
213209
* @description Adds new segment at current pointer level.
214210
*
@@ -229,7 +225,7 @@ mod.provider( '$routeSegment',
229225
* @name $routeSegmentProvider.Pointer#within
230226
* @param {String=} childName An existing segment's name. If undefined, then the last added segment is selected.
231227
* @returns {$routeSegmentProvider.Pointer} The pointer to the child segment.
232-
* @throws {Error} when {@link $routeSegmentProvider#strictDi $routeSegmentProvider#strictDi} is true and segment with given name is not found
228+
* @throws {Error} when {@link $routeSegmentProvider.options#strictMode $routeSegmentProvider.options#strictMode} is true and segment with given name is not found
233229
* @description Traverses into an existing segment, so that subsequent `segment` calls
234230
* will add new segments as its descendants.
235231
*/
@@ -337,7 +333,7 @@ mod.provider( '$routeSegment',
337333
/**
338334
* @ngdoc property
339335
* @name $routeSegment#chain
340-
* @type {Array<$routeSegment.Segment>}
336+
* @type {Array.<$routeSegment.Segment>}
341337
* @description Array of segments splitted by each level separately. Each item contains the following properties:
342338
*
343339
* - `name` is the name of a segment;
@@ -584,7 +580,6 @@ mod.provider( '$routeSegment',
584580
* @ngdoc type
585581
* @module route-segment
586582
* @name $routeSegment.Segment
587-
* @protected
588583
* @description Segment record
589584
*/
590585
$routeSegment.chain[index] = {
@@ -612,7 +607,7 @@ mod.provider( '$routeSegment',
612607
/**
613608
* @ngdoc method
614609
* @name $routeSegment.Segment#reload
615-
* @description reloads current segment from scratc
610+
* @description reloads current segment from scratch
616611
*/
617612
reload: function() {
618613
var originalSegment = getSegmentInChain(index, $routeSegment.name.split("."));
@@ -723,6 +718,7 @@ mod.provider( '$routeSegment',
723718
* @name routeSegmentUrl
724719
* @param {String} name fully qualified segment name
725720
* @param {Object} params params to resolve segment
721+
* @returns {string} given url
726722
* @description Returns url for a given segment
727723
*
728724
* Usage:
@@ -740,8 +736,17 @@ mod.filter('routeSegmentUrl', ['$routeSegment', function($routeSegment) {
740736
}]);
741737

742738
/**
739+
* @ngdoc filter
740+
* @module route-segment
741+
* @name routeSegmentEqualsTo
742+
* @param {String} name fully qualified segment name
743+
* @returns {boolean} true if given segment name is the active one
744+
* @description Check whether active segment equals to the given segment name
745+
*
743746
* Usage:
747+
* ```html
744748
* <li ng-class="{active: ('index.list' | routeSegmentEqualsTo)}">
749+
* ```
745750
*/
746751
mod.filter('routeSegmentEqualsTo', ['$routeSegment', function($routeSegment) {
747752
var filter = function(value) {
@@ -752,8 +757,17 @@ mod.filter('routeSegmentEqualsTo', ['$routeSegment', function($routeSegment) {
752757
}]);
753758

754759
/**
760+
* @ngdoc filter
761+
* @module route-segment
762+
* @name routeSegmentStartsWith
763+
* @param {String} name segment name
764+
* @returns {boolean} true if active segment name begins with given name
765+
* @description Check whether active segment starts with the given segment name
766+
*
755767
* Usage:
768+
* ```html
756769
* <li ng-class="{active: ('section1' | routeSegmentStartsWith)}">
770+
* ```
757771
*/
758772
mod.filter('routeSegmentStartsWith', ['$routeSegment', function($routeSegment) {
759773
var filter = function(value) {
@@ -764,8 +778,17 @@ mod.filter('routeSegmentStartsWith', ['$routeSegment', function($routeSegment) {
764778
}]);
765779

766780
/**
781+
* @ngdoc filter
782+
* @module route-segment
783+
* @name routeSegmentContains
784+
* @param {String} name segment name
785+
* @returns {boolean} true if active segment contains given name
786+
* @description Check whether active segment contains the given segment name
787+
*
767788
* Usage:
789+
* ```html
768790
* <li ng-class="{active: ('itemInfo' | routeSegmentContains)}">
791+
* ```
769792
*/
770793
mod.filter('routeSegmentContains', ['$routeSegment', function($routeSegment) {
771794
var filter = function(value) {
@@ -776,8 +799,17 @@ mod.filter('routeSegmentContains', ['$routeSegment', function($routeSegment) {
776799
}]);
777800

778801
/**
802+
* @ngdoc filter
803+
* @module route-segment
804+
* @name routeSegmentParam
805+
* @param {String} name param name
806+
* @returns {string|undefined} param value or undefined
807+
* @description Returns segment parameter by name
808+
*
779809
* Usage:
810+
* ```html
780811
* <li ng-class="{active: ('index.list.itemInfo' | routeSegmentEqualsTo) && ('id' | routeSegmentParam) == 123}">
812+
* ```
781813
*/
782814
mod.filter('routeSegmentParam', ['$routeSegment', function($routeSegment) {
783815
var filter = function(value) {
@@ -788,4 +820,4 @@ mod.filter('routeSegmentParam', ['$routeSegment', function($routeSegment) {
788820
}]);
789821

790822

791-
})(angular);
823+
})(angular);

src/view-segment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @ngdoc module
55
* @module view-segment
66
* @name view-segment
7+
* @packageName angular-route-segment
78
* @requires route-segment
89
* @description
910
* view-segment is a replacement for [ngView](https://docs.angularjs.org/api/ngRoute/directive/ngView) AngularJS directive.
@@ -62,7 +63,6 @@
6263
* @requires https://docs.angularjs.org/api/ng/service/$animate $animate
6364
* @restrict ECA
6465
* @priority 400
65-
* @transclude
6666
* @param {String} appViewSegment render depth level
6767
* @description Renders active segment as specified by parameter
6868
*

0 commit comments

Comments
 (0)