Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIView multiple views? #58

Closed
dspencerr opened this issue Jun 8, 2017 · 3 comments
Closed

UIView multiple views? #58

dspencerr opened this issue Jun 8, 2017 · 3 comments

Comments

@dspencerr
Copy link

Thanks so much for the port to ReactJs! Cannot imagine routing without ui-router.

I've spent many years using UI-Router with Angular, now I have moved to react, and am using the port. I know we can make multiple views in angular via

and then defining views:{ 'myView':{component:myComponent} }.

Wondering how to do this in React? I went through the docs and examples, and did not see it. Totally could have been me missing it though. Thanks again!

@Kukkimonsuta
Copy link
Contributor

I have not used multiple views yet, but you can see how it may be done here: https://github.com/ui-router/sample-app-react/blob/master/src/mymessages/states.js

@dspencerr
Copy link
Author

Thanks @Kukkimonsuta. I had not seen that example app, and it had a lot of good stuff in it.
'^.^.$default': {
//bindings: { pristineContact: "contact" },
component: EditContact
}
I believe what you were referring to was this line of code. It was helpful, and I realized you can target parent UIViews with children ... which is awesome. The problem still exists, I cannot for the live of me figure out how to make the "named" UIView. What does that HTML look like?

<UIView ui-view={'myNamedView'} />

Not really sure how to create the named uiview for the state with multiple views to target. Thanks for responding though, it was really useful.

@dspencerr
Copy link
Author

dspencerr commented Jun 9, 2017

Ok, I am thick.

<UIView name='bill' />

that worked

@elboman elboman closed this as completed Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants