Skip to content

Commit 79d7aa5

Browse files
Update README.md
1 parent 5e01a66 commit 79d7aa5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# feature-1.0 branch
2-
## Note: this is a pre-alpha preview of UI-Router 1.0
2+
## Note: this is an alpha version of UI-Router 1.0
33

44
We've totally redesigned UI-Router under the covers (rewrote about 60% of the codebase!), separating concerns and detangling the spaghetti. We have taken some new approaches which we hope will provide unprecedented flexibility and control to your UI-Router app.
55

6+
Have a look at our new [Sample application](http://ui-router.github.io/sample-app/#/mymessages/inbox/5648b50cc586cac4aed6836f)
7+
([Source on GitHub](http://github.com/ui-router/sample-app))
8+
69
#### What's changed?
710

811
##### Resolves
@@ -30,23 +33,24 @@ When registering a hook, you can provide criteria (a state name, a glob, or a fu
3033

3134
This enables lots of fun stuff! Here are a couple of possibilities to get your imagination started:
3235
```javascript
36+
// Perform some async thing before running the transition
3337
$transitionsProvider.onBefore({ to: 'my.state', from: '*' }, function(AsyncService) {
3438
return AsyncService.doSomeAsyncThing();
3539
});
3640

41+
// Add resolves to a transitoin on-the-fly
3742
$transitionsProvider.onBefore({ to: 'other.state', from: '*' }, function($transition$, AsyncService) {
3843
// someAsyncResult added as resolve to transition. It is injectable into other resolves or controllers.
3944
$transition$.addResolves({ someAsyncResult: AsyncService.doSomeAsyncThing });
4045
});
4146

47+
// Declaratively protect states which require authentication; redirect to 'login' if the user is unauthenticated.
4248
$transitionsProvider.onStart({ to: function(state) { return state.requiresAuth; } }, function($transition$, $state, AuthService) {
4349
return AuthService.ensureAuthenticated().catch(function() { return $state.target("login"); });
4450
});
4551

46-
$transitionsProvider.onStart({ to: function(state) { return state.requiresAuth; } }, function($transition$, $state, AuthService) {
47-
return AuthService.ensureAuthenticated().catch(function() { return $state.target("login"); });
48-
});
49-
52+
// Declaratively set up default substates or other redirects; Redirect to a different target state
53+
// as declared on the original state, i.e., redirectTo: 'someotherstate'
5054
$transitionsProvider.onStart({ to: function(state) { return state.redirectTo; } }, function($transition$, $state) {
5155
return $state.target($transition$.to.redirectTo); });
5256
});
@@ -74,11 +78,11 @@ Build it. Try it. Let us know what's horribly broken.
7478

7579
#### ES6/TypeScript
7680

77-
We have plans to migrate these new classes to ES6 (for sure), and possibly Typescript.
81+
We have migrated our codebase to ES6 and Typescript.
7882

7983
#### Angular 2
8084

81-
We'd like to support Angular 2
85+
We'd are going to support Angular 2. We plan to release a ui-router-ng2 around the same time ng2 final is released.
8286

8387
#### Lazy Loading
8488

0 commit comments

Comments
 (0)