Copied to clipboard

Flag this post as spam?

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


  • Tom 117 posts 443 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 11258 posts 23500 karma points MVP 7x admin c-trib
    Mar 28, 2014 @ 16:31
    Jan Skovgaard
    0

    Hi Tom

    Why do you need to remove it?

    /Jan

  • Tom 117 posts 443 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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies