You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 11, 2021. It is now read-only.
Hi, thanks for this, I got this error when I have state profile with default nested state about and configuring the ui-router to redirect to profile.about when profile state is requested the styles files doesn't get loaded unless I click on the link or the about state directly or reload the page here's a plunker with the error.
Update
After further investigation, using this better plunker the acctual problem was not calling the $state.go directly it was having a nested states with default child state, due to this bug on ui-router I had to use the hack mentioned there to navigate to the child state with this code:
$rootScope.$on('$stateChangeStart', function (event, toState) {
var url, routeRegex;
routeRegex = /^profile$/;
if (routeRegex.test(toState.name)) {
event.preventDefault();
url = toState.name + '.about';
$state.go(url);
}
});
That code runs when navigating directly to the parent profile state which have the profile.about as default state, by clicking on the profile link on the navigation like this:
as seen in the picture the profile.about state data object gets redefined by the parent profile state because of when the code above gets run the order of defining the data.css attribute of the state config object gets changed so the data of the child state gets defined before the data from the parent child which means the child's state data gets overwritten by the parent data, so this is probably a bug with the ui-router not the this plugin.
And when navigating with the correct state name profile.about everything works as expected:
when we go to the profile.feed state by clicking the link for it:
Then going back to the profile.about state using the link for it not the profile one:
I may just use the parent to handle all the CSS for children for now, I can see any other solution.
The text was updated successfully, but these errors were encountered:
Hi, thanks for this, I got this error when I have state profile with default nested state about and configuring the ui-router to redirect to profile.about when profile state is requested the styles files doesn't get loaded unless I click on the link or the about state directly or reload the page here's a plunker with the error.
Update
After further investigation, using this better plunker the acctual problem was not calling the $state.go directly it was having a nested states with default child state, due to this bug on ui-router I had to use the hack mentioned there to navigate to the child state with this code:
That code runs when navigating directly to the parent
profile
state which have theprofile.about
as default state, by clicking on the profile link on the navigation like this:as seen in the picture the profile.about state data object gets redefined by the parent profile state because of when the code above gets run the order of defining the data.css attribute of the state config object gets changed so the data of the child state gets defined before the data from the parent child which means the child's state data gets overwritten by the parent data, so this is probably a bug with the ui-router not the this plugin.
And when navigating with the correct state name profile.about everything works as expected:
when we go to the profile.feed state by clicking the link for it:
Then going back to the profile.about state using the link for it not the profile one:
I may just use the parent to handle all the CSS for children for now, I can see any other solution.
The text was updated successfully, but these errors were encountered: