|
27 | 27 | <strong>Route Action</strong>: {{ routeAction }}
|
28 | 28 | </p>
|
29 | 29 |
|
30 |
| - <!-- BEGIN: Route Activity Notification. --> |
| 30 | + <!-- |
| 31 | + BEGIN: Route Activity Notification. This indicator will show up while the |
| 32 | + route is being resolved. This will give the user some indication that "work" |
| 33 | + is being done. |
| 34 | + --> |
31 | 35 | <div
|
32 | 36 | ng-controller="RouteActivityController"
|
33 | 37 | ng-show="isResolvingRoute"
|
|
63 | 67 | {
|
64 | 68 | action: "section-a",
|
65 | 69 | resolve: {
|
66 |
| - thingOne: function( $timeout ) { |
| 70 | + thingOne: function( $q ) { |
67 | 71 |
|
68 |
| - // Resolved with timeout. |
69 |
| - // -- |
70 |
| - // NOTE: Since $timeout() won't resolve with a |
71 |
| - // "value", then "thingOne" will be undefined in |
72 |
| - // "locals" within the $route.current object. |
73 |
| - return( $timeout( angular.noop, 1000, false ) ); |
74 |
| - |
75 |
| - }, |
76 |
| - thingTwo: function( $q, $timeout ) { |
77 |
| - |
78 |
| - // Immediately resolved. |
79 |
| - return( $q.when( "thingTwoValue" ) ); |
| 72 | + // Immediately resolved with static value. |
| 73 | + return( "thingOneValue" ); |
80 | 74 |
|
81 | 75 | }
|
82 | 76 | }
|
|
87 | 81 | {
|
88 | 82 | action: "section-b",
|
89 | 83 | resolve: {
|
90 |
| - thingThree: function( $q ) { |
| 84 | + thingTwo: function( $timeout ) { |
| 85 | + |
| 86 | + // Resolved with timeout. |
| 87 | + // -- |
| 88 | + // NOTE: Since $timeout() won't resolve with a |
| 89 | + // "value", then "thingTwo" will be undefined in |
| 90 | + // "locals" within the $route.current object. |
| 91 | + return( $timeout( angular.noop, 1000, false ) ); |
| 92 | + |
| 93 | + }, |
| 94 | + thingThree: function( $q, $timeout ) { |
91 | 95 |
|
92 |
| - // Immediately resolved. |
| 96 | + // Immediately resolved with promise. |
93 | 97 | return( $q.when( "thingThreeValue" ) );
|
94 | 98 |
|
95 | 99 | }
|
|
140 | 144 |
|
141 | 145 | // When the route is finally resolved, the results of the
|
142 | 146 | // resolution will be available in the ".locals" object on the
|
143 |
| - // current route. This object always exists, but will be empty |
144 |
| - // if the route didn't have to resolve anything. |
| 147 | + // current route. This object always exists (upon success), but |
| 148 | + // will be empty if the route didn't have to resolve anything. |
145 | 149 | // --
|
146 | 150 | // CAUTION: "locals" only exists when route is resolved - it will
|
147 | 151 | // not exist if the route was rejected.
|
|
0 commit comments