AngularJs - routing between css files

谁说胖子不能爱 提交于 2019-12-25 06:27:49

问题


​Hi all.. referring to ngRoute,

i created a single page application but would like to apply different css rules to each sub-page like background image

how can i do that?

i assigned a different controller to each sub-page and in the link tag i used ng-href and {{name}}.css to tell the browser to grap the correct css file where is name is giving the value of the file name and attached to the scope inside the corresponding controller. is there a need to use more than one ng-controller ? here is the view : http://shireefkhatab.github.io/imax-design and my code : https://github.com/shireefkhatab/imax-design​

hope to get a response thank you all in advance. Reefo.


回答1:


You can include those styles in your template (views) or make separate route for styles, add its view in head section and then change state from your controller using $state.go('where.ever.you.want.to.go');



来源:https://stackoverflow.com/questions/37096576/angularjs-routing-between-css-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!