castillo-io / angular-css

CSS on-demand for AngularJS [Looking for New Maintainers]
http://castillo-io.github.io/angular-css/#/
MIT License
470 stars 86 forks source link

Does this support abtract states for ui-router ? #25

Closed iangregsondev closed 8 years ago

iangregsondev commented 9 years ago

Hi there,

I was wanting a way to include a certain CSS file (which is dynamic) on each and every state. I was thinking of doing this via an abstract state and having all other states use the abstract.

Does this support abstract states?

The css I need to include on every page would be available in a variable but I just can't insert it onto the page as it changes depending on certain this.

Is there support for this ?

kenny-f commented 9 years ago

From digging into the source and testing on my project it currently does not support abstract states.

This would be a killer feature as I suspect most people will have a abstract states that define a base layout that other child states will populate the ui-view.

I'm currently working on a project with an abstract base 'frontend' state (home, login, register pages) and an abstract base 'dashboard' state. It would be great if I could define a set of css files for both abstract states whenever a child state is instantiated.

However, I do not see an easy way to go up the state tree.

alexcastillo commented 9 years ago

Hi @ianjohnmadrid and @kenny-f

I can see the value of adding this as a feature. I'm going to look into it and see how we can approach this.

Thanks!

iangregsondev commented 9 years ago

Great news. Thanks

kenny-f commented 9 years ago

Thanks!

My current workaround is to have a controller on the base abstract state and load the css from there.

alexcastillo commented 9 years ago

That is a good workaround for the time being. I'll still look into it so we can do this properly.

felixfbecker commented 9 years ago

I have an abstract state that contains a navbar, a ui-view and a footer. It is abstract because there should always be content inside the ui-view. But the navbar has its own stylesheet that I need to load... please add this feature.

DahliaWitt commented 8 years ago

What is that status of this feature?

heston commented 8 years ago

Looks like this PR added support for inheritance via abstract states when using the 'data' property.

alexcastillo commented 8 years ago

I believe this was resolved in #35. Releasing soon.

alexcastillo commented 8 years ago

Fixed in v1.0.8