@@ -30,24 +30,24 @@ When registering a hook, you can provide criteria (a state name, a glob, or a fu
3030
3131This enables lots of fun stuff! Here are a couple of possibilities to get your imagination started:
3232```
33- $transitionProvider .onBefore({ to: 'my.state', from: '*' }, function(AsyncService) {
33+ $transitionsProvider .onBefore({ to: 'my.state', from: '*' }, function(AsyncService) {
3434 return AsyncService.doSomeAsyncThing();
3535});
3636
37- $transitionProvider .onBefore({ to: 'other.state', from: '*' }, function(AsyncService) {
37+ $transitionsProvider .onBefore({ to: 'other.state', from: '*' }, function(AsyncService) {
3838 // someAsyncResult added as resolve to transition. It is injectable into other resolves or controllers.
3939 return { someAsyncResult: AsyncService.doSomeAsyncThing };
4040});
4141
42- $transitionProvider .onStart({ to: function(state) { return state.requiresAuth; } }, function($transition$, $state, AuthService) {
42+ $transitionsProvider .onStart({ to: function(state) { return state.requiresAuth; } }, function($transition$, $state, AuthService) {
4343 return AuthService.ensureAuthenticated().catch(function() { return $state.redirect("login"); });
4444});
4545
46- $transitionProvider .onStart({ to: function(state) { return state.requiresAuth; } }, function($transition$, $state, AuthService) {
46+ $transitionsProvider .onStart({ to: function(state) { return state.requiresAuth; } }, function($transition$, $state, AuthService) {
4747 return AuthService.ensureAuthenticated().catch(function() { return $state.redirect("login"); });
4848});
4949
50- $transitionProvider .onStart({ to: function(state) { return state.redirectTo; } }, function($transition$, $state) {
50+ $transitionsProvider .onStart({ to: function(state) { return state.redirectTo; } }, function($transition$, $state) {
5151 return $state.redirect($transition$.to.redirectTo); });
5252});
5353```
0 commit comments