Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 120 posts 448 karma points
    Mar 28, 2014 @ 13:32
    Tom
    0

    angularjs - unload a css file

    Can you unload a css file again dynamically?

    I use this to load the style sheet:

    assetsService.loadCss("/themes/awesometheme/awesome.css");

    Can I somehow do something like this?

    assetsService.removeCss("/themes/notsoawesometheme/notsoawesometheme.css");

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 28, 2014 @ 16:31
    Jan Skovgaard
    0

    Hi Tom

    Why do you need to remove it?

    /Jan

  • Tom 120 posts 448 karma points
    Mar 28, 2014 @ 21:23
    Tom
    100

    Hey Jan

    I'm creating a sort of a theme-picker. When you pick a theme in a select an example of the chosen theme is rendered. Instead of changing css class names I thought it would be better to change the style sheet.

    I've got it working by using a link element instead and just changing the path to the css-files.

Please Sign in or register to post replies

Write your reply to:

Draft