javascript - How to change body style using angular -


i have following code , bunch of other angular code :-

<body class="ftb2">  lot of code here </body> 

and in angular controller have

var bodytemp = $document[0].body;                 bodytemp.removeclass("ftb2"); 

it gets bodytemp not remove class. chrome debugger :-

bodytemp: body.ftb2 alink: "" 

etc....

not sure reason?

ps:- angualar scope defined inside div within body , cannot change code :-

<body class="ftb2"> <!-- angular boot strapped id--> <div id="xyz"> </div> </body> 

bootstrap code :-

var root = document.getelementbyid("xyz");   angular.bootstrap(root, ["appinvest"]) 

its bad way of doing this, since there no option need add dom manipulation controller.

angular.element($document).find('body').removeclass('ftb2') 

working plunkr


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -