r/angularjs • • Apr 18 '16

UI Router Cheat Sheet

https://www.trainwithmike.us/blogs/geeks-only/103066054-ui-router-cheat-sheet
52 Upvotes

14 comments sorted by

View all comments

3

u/cac2573 Apr 20 '16
$stateProvider
  .state('state-name', {
    url: 'some/url',
    component: 'component-name'
  });

Can we route directly via components now? I don't see anything about it in the docs.

1

u/consultwithmike Apr 20 '16

Yeah, per this commit (https://github.com/angular-ui/ui-router/commit/15520328abba69630f5c557f17d828e0205a7f20) this should work now as long you're leveraging Angular 1.5 as well.

2

u/cac2573 Apr 20 '16

Ah, so we would need to use the 1.0 alpha.

1

u/consultwithmike Apr 20 '16

That is correct. I was considering noting that in the cheat sheet; I think I may for now. My concern with noting it was actually remembering to pull it out later when 1.0 is released.