This is the code I wrote for the view:

<header class="orgWall" ng-style="{{organCover}}"></header>

This is the code I wrote for changing the background-image. This is the js 
file code:

   Organization.get(function(organ) {
    $scope.organCover = "{'background-image': 
\"url('"+organ.organ_cover+"')\"}";
   });

Organization is a $resource object. I give value to $scope.organCover after 
the promise is fulfilled. The problem is the view is not updated, and the 
inline style is not added.

This is the generated code I found in chrome console:

<header class="orgWall" ng-style="{'background-image': 
\"url('http://localhost/dooleystand/ci/public/images/organs/2/profile_pic.jpg')\"}">
 
</header>

It seems like the generated code works, but isn't added to actual inline 
style. I guess this might have something to do with the asynchronous 
promise. I tried to add $scope.$digest() right after I assigned the url 
value to $scope.organCover, but it didn't work.

After at least two hours of trying...so exhausted. 

-- 
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