Angular ng-style not changing with property

Posted by ganaraj on Stack Overflow See other posts from Stack Overflow or by ganaraj
Published on 2012-05-24T11:52:19Z Indexed on 2014/08/21 22:20 UTC
Read the original article Hit count: 260

Filed under:
|
|

For the life of me I cant seem to figure out why the style property is not getting updated. In my larger application it seems to work fine.

http://jsfiddle.net/ganarajpr/C2hRa/4/

Here is a fiddle which shows the issue I am currently facing. You will notice that the width and height are getting updated in the div when you change the input. But the style itself doesnt seem to be updating. Anyone can tell me what I am doing wrong here?

I have tried all the following scenarios

  1. using $scope.$apply.. - Throws an error stating $apply already in progress..
  2. $rootScope.$apply - same as above.
  3. Setting another variable in a service which is $watched in the other controller. - no change seen.

It would be really cool if someone can get me an answer to this. Also would be really happy if you can tell me why exactly it is not getting updated.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about angularjs