Hi,

I have an application where the user can change CSS dynamically, for 
example, the body font size.

My first approach at implementing this was:

  <style type="text/css">
  body { font-size:{{the.fontsize}} }
  </style>

This causes the browser to spit errors because it tries to parse the CSS 
statements before AngularJS has had a chance to fill in the parameters. 
What works is this:

  <style type="text/css" ng-bind-html="print_style()">
  </style>

But then I need to create all the css text in the code. With more complex 
CSS than in this example, things get very ugly.

Isn't there a better way? Would something like the following be possible 
and reasonable?

  <ng-style type="text/css">
  body { font-size:{{the.fontsize}} }
  </ng-style>

Thanks,
Andreas

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to