Jaspreet
Jaspreet

Reputation: 101

loading CSS from angular js

I am new to developement in aangular js. I have a task of loading the CSS template for page dynamically, by taking the name of CSS template from JSON object returned from the http Servlet. I need to call angular before the page is rendered.

Upvotes: 0

Views: 74

Answers (2)

Jaspreet
Jaspreet

Reputation: 101

Well, I found the way to solve my problem, the best way to approach this is to understand the bootstrapping of application. As far as calling the script before RENDERING the page is concerned, I followed the explanation and example discussed at: http://docs.angularjs.org/guide/bootstrap This solved my issue.

Upvotes: 1

Ben Ohana
Ben Ohana

Reputation: 179

You can use ng-href directive like this:

<link ng-href="{{file}}" type="text/css"/>

Working plunker

Upvotes: 0

Related Questions