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

change to child states don't show spinners #1

Open
pdemilly opened this issue Jul 30, 2015 · 4 comments
Open

change to child states don't show spinners #1

pdemilly opened this issue Jul 30, 2015 · 4 comments

Comments

@pdemilly
Copy link

Let's say my index.html has a named view

<ui-loading-view name="main" root-state="wep"></ui-loading-view>

and I define my router with a a hierarchy of states. the spinner won't show when changing from wep.contacts state to wep.contacts.edit state.

$stateProvider.state ('wep', {
url: '/',
abstract: true,
resolve: {
}
})
.state ('wep.contacts', {
url: '/contacts',
views: {
'main@': {
template: '<h1>Contacts view</h1><button ui-sref=".edit">Edit</button>'
controller: 'wep.contacts.controller',
controllerAs: 'vm',
},
contactList: function ($timeout) {
$timeout (function () { return [], 5000 });
});
}).state ('wep.contacts.edit', {
url: '/edit',
views: {
'main@': {
template: '<h1>edit contact view</h1>'
controller: 'wep.contacts.edit.controller',
controllerAs: 'vm',
},
resolve: {
contact: function ($timeout) {
$timeout (function () { return { name: John Doe' }, 5000 });
});
@rpocklin
Copy link
Owner

I haven't run your code, but if you take a look at the example it does what you speak of.

http://rp.js.org/angular-ui-view-spinner/example/index.html#/two

If you click 'A' or 'B' from that route it will show a spinner and load a sub-route of #/two - is this what you are trying to achieve?

@rpocklin
Copy link
Owner

BTW there's too many syntax errors (missing commas, quotes) for me to make use of that example code you added.

@pdemilly
Copy link
Author

sorry I didn't copy and paste just duck typed it to give an idea. Basically a child state redefines the same view of the parent and in between we should see the spinner and I don't

@rpocklin
Copy link
Owner

rpocklin commented Aug 4, 2015

I'm looking into making this work for silbing without a base root state, which may fix this issue. PRs welcome, or even if you add a failing test to kickoff a PR that will be useful.

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

2 participants