-
Notifications
You must be signed in to change notification settings - Fork 90
Remove dynamic stylesheets added #3
Comments
Thanks for open this issue. I updated the code to allow this feature. Check the readme file. |
Thanks for adding this feature. I am noticing the behavior of "add" happening before the "removeAll" happening. Let me know if I'm setting this up properly
When I load the user list page, the proper style(body {color: red;}) gets applied from userList.css. Then I navigate to some other page like settings and the styling is removed as I see the removeAll call. However, when I navigate to the user list page again, I see "add" being called in the console before the removeAll, essentially erasing the userList.css inclusion. Please let me know if you have any insights. |
Hi @drelei : The function removeAll is fired on the event $locationChangeStart. In my personal project, I'm doing a lazy loading for css and js files, so $locationChangeStart is always called before my controller be load. Your example is an interesting case. Unfortunately I only have a dirty solution to recommend you today :
I'm looking for a clean fix, but I don't have enough time this days. I reopen this issue until a clean fix be found. |
Hi @yappli , Thank you for your suggestion and the continued support of the project when available. I'm not sure if it's the way ui-router works, but I'm seeing the controller fired (add activity) before the $locationChangeStart which wipes everything out with the removeAll. I tried a workaround by performing the add via $locationChangeSuccess. However, it has a residual issue where going to the next page will end up performing the add from Page 1. Hope that helps,
|
how I can remove all dynamic stylesheets added before add new stylesheet in header on a single page application?
The text was updated successfully, but these errors were encountered: