Skip to content

Commit be475eb

Browse files
committedFeb 12, 2015
Small tweaks.
1 parent 2b73734 commit be475eb

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed
 

‎demos/route-resolve-angularjs/index.htm

+22-18
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ <h1>
2727
<strong>Route Action</strong>: {{ routeAction }}
2828
</p>
2929

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+
-->
3135
<div
3236
ng-controller="RouteActivityController"
3337
ng-show="isResolvingRoute"
@@ -63,20 +67,10 @@ <h1>
6367
{
6468
action: "section-a",
6569
resolve: {
66-
thingOne: function( $timeout ) {
70+
thingOne: function( $q ) {
6771

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" );
8074

8175
}
8276
}
@@ -87,9 +81,19 @@ <h1>
8781
{
8882
action: "section-b",
8983
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 ) {
9195

92-
// Immediately resolved.
96+
// Immediately resolved with promise.
9397
return( $q.when( "thingThreeValue" ) );
9498

9599
}
@@ -140,8 +144,8 @@ <h1>
140144

141145
// When the route is finally resolved, the results of the
142146
// 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.
145149
// --
146150
// CAUTION: "locals" only exists when route is resolved - it will
147151
// not exist if the route was rejected.

0 commit comments

Comments
 (0)
Please sign in to comment.