|
3 | 3 | <div class="well">
|
4 | 4 | <ul class="nav nav-list">
|
5 | 5 |
|
6 |
| - <li ng-class="{active: $routeSegment.name == 's1.home'}"><a href="#/section1/">Home</a></li> |
| 6 | + <li ng-class="{active: ('s1.home' | routeSegmentStartsWith)}"> |
| 7 | + <a href="#{{ 's1' | routeSegmentUrl }}">Home</a> |
| 8 | + </li> |
7 | 9 |
|
8 | 10 | <li class="nav-header">Items</li>
|
9 | 11 |
|
10 | 12 | <li ng-repeat="i in items"
|
11 |
| - ng-class="{active: $routeSegment.startsWith('s1.itemInfo') && $routeSegment.$routeParams.id == i}"> |
12 |
| - |
13 |
| - <a ng-href="#/section1/{{i}}">Item {{i}}</a> |
14 |
| - |
| 13 | + ng-class="{active: ('s1.itemInfo' | routeSegmentStartsWith) && ('id' | routeSegmentParam) == i}"> |
| 14 | + <a ng-href="#{{ 's1.itemInfo' | routeSegmentUrl: {id: i} }}">Item {{i}}</a> |
15 | 15 | </li>
|
16 | 16 |
|
17 |
| - <li ng-class="{active: $routeSegment.startsWith('s1.prefs')}"> |
18 |
| - <a href="#/section1/prefs">Preferences</a> |
| 17 | + <li ng-class="{active: ('s1.prefs' | routeSegmentStartsWith)}"> |
| 18 | + <a href="#{{ 's1.prefs' | routeSegmentUrl }}">Preferences</a> |
19 | 19 | </li>
|
20 | 20 |
|
21 | 21 | <li class="nav-header">Error handling</li>
|
22 | 22 |
|
23 |
| - <li ng-class="{active: $routeSegment.startsWith('s1.invalidTemplate')}"> |
24 |
| - <a href="#/invalid-template">Invalid template file</a> |
| 23 | + <li ng-class="{active: ('s1.invalidTemplate' | routeSegmentStartsWith)}"> |
| 24 | + <a href="#{{ 's1.invalidTemplate' | routeSegmentUrl }}">Invalid template file</a> |
25 | 25 | </li>
|
26 | 26 |
|
27 |
| - <li ng-class="{active: $routeSegment.startsWith('s1.invalidData')}"> |
28 |
| - <a href="#/invalid-data">Invalid resolve data</a> |
| 27 | + <li ng-class="{active: ('s1.invalidData' | routeSegmentStartsWith)}"> |
| 28 | + <a href="#{{ 's1.invalidData' | routeSegmentUrl }}">Invalid resolve data</a> |
29 | 29 | </li>
|
30 | 30 |
|
31 | 31 | <li class="nav-header">Slow data resolving</li>
|
32 | 32 |
|
33 |
| - <li ng-class="{active: $routeSegment.startsWith('s1.slowDataSimple')}"> |
34 |
| - <a href="#/slow-data">Without `untilResolved`</a> |
| 33 | + <li ng-class="{active: ('s1.slowDataSimple' | routeSegmentStartsWith)}"> |
| 34 | + <a href="#{{ 's1.slowDataSimple' | routeSegmentUrl }}">Without `untilResolved`</a> |
35 | 35 | </li>
|
36 | 36 |
|
37 |
| - <li ng-class="{active: $routeSegment.startsWith('s1.slowDataLoading')}"> |
38 |
| - <a href="#/slow-data-loading">With `untilResolved`</a> |
| 37 | + <li ng-class="{active: ('s1.slowDataLoading' | routeSegmentStartsWith)}"> |
| 38 | + <a href="#{{ 's1.slowDataLoading' | routeSegmentUrl }}">With `untilResolved`</a> |
39 | 39 | </li>
|
40 | 40 |
|
41 |
| - <li ng-class="{active: $routeSegment.startsWith('s1.inlineView')}"> |
42 |
| - <a href="#/inline-view">Inline view</a> |
| 41 | + <li ng-class="{active: ('s1.inlineParent' | routeSegmentStartsWith)}"> |
| 42 | + <a href="#{{ 's1.inlineParent' | routeSegmentUrl }}">Inline view</a> |
43 | 43 | </li>
|
44 | 44 |
|
45 | 45 | <li class="divider"></li>
|
|
0 commit comments