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

feat: Add routing using a wrapper controller #1134

Merged
merged 2 commits into from
May 9, 2018

Conversation

rjmackay
Copy link
Contributor

@rjmackay rjmackay commented May 8, 2018

No description provided.

@rjmackay rjmackay force-pushed the react-routing-wrapper branch from 3e5949f to 5323950 Compare May 8, 2018 23:58
<h1>Hello from react</h1>
{ props.id }
<a onClick={ () => { props.state.go('posts.data') } }>Click me</a>
<a href="/views/map">Click me</a>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a simple href works just as well as using state.go so I'd probably stick with hrefs for simpler refactoring in future.

url: '/settings/testroute/:id?',
controller: ['$scope', '$state', '$transition$', ($scope, $state, $transition$) => {
$scope.$state = $state;
$scope.id = $transition$.params().id;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling params here keeps that from polluting our react code for now

@crcommons crcommons merged commit 0a447fa into add-redux May 9, 2018
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

Successfully merging this pull request may close these issues.

2 participants