Namespaces not applying during ember `loading` states
See original GitHub issueHaving a strange issue where the styles don’t seem to apply to the route templates when they are in a loading state as described here:
https://guides.emberjs.com/v2.15.0/routing/loading-and-error-substates/
Not sure if I am doing something wrong but code looks roughly like:
<div class="{{styleNamespace}}__content">
...
</div>
Any components have their css namespace classes applied so it seems like whatever is hooking in to generate the namespace is not triggered until loading is complete.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Namespaces not applying during ember loading states #286
Having a strange issue where the styles don't seem to apply to the route templates when they are in a loading state as...
Read more >Route - 4.9 - Ember API Documentation
This event is triggered when the router enters the route. It is not executed when the model for the route changes. app/routes/application.js ...
Read more >Why do nested resource routes reset the namespace in Ember?
It's because when you transition to routes you don't explicitly call out an entire path. this.transitionTo('photo', photo); {{#link-to ' ...
Read more >ember-engines - npm
The only difference is that lazily loaded Engines will enter a loading state while the assets for the Engine are loaded and can...
Read more >The State of the Ember Addon Ecosystem in 2019 - Salsify
Build-time Build-time addons provide command-line tools that help developers during the creation of the application. An example is ember-cli- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
the problem we’re seeing is this: when we access route
foo.bar
andbar
has a loading template then even the class for thefoo
route will only be applied oncebar
has loaded (aka. the transition has finished)this seems like a major caveat to using this addon with per-route style files and should at least be mentioned in the README if we can’t find a solution.
after writing the above lines I experimented a bit and I think I might have found a solution. instead of using the regular route style assignment code I’m using this:
and the application controller looks like this:
caveat: this workaround does not assign the
styleNamespace
to controllers yet. we don’t use that feature so I didn’t care much about it. it should be possible to implement that part too though.@Turbo87 I just released a
0.7.4
and I am using it with error and loading states. do you have any more info into how you are setting up the loading state, and how you are getting there?