AngularJS supports .css() jQuery functionality. Here in below examples we can see how to set style to an element.
Angular2 : If you are looking for Angular2 solution, Please click here

Steps to set style to an elemnt :

  1. Get angular element of html element
  2. Use .css() set  style to that element
var myEl = angular.element( document.querySelector( '#divID' ) );
myEl.css('color','red'));

Set style using ng-style

<html ng-app="" ng-controller="myCtrl">
....
<button ng-click="myStyle={color:'red'}">Set Color</button>
<button ng-click="myStyle={'background-color':'blue'}">Set Background color</button>
<button ng-click="myStyle = {}">Set Background color</button>
<div>Click above buttons</div>
<script>
function myCtrl($scope) {
    $scope.myStyle = {};
}
</script>
Try It Your Self

16 comments:

  1. Big Truck Tow: Heavy Duty towing service san jose

    We're rated the most reliable heavy duty towing san jose service & roadside assistance in San Jose!
    Call us now! We're ready to help you NOW!

    Since 1999, tow truck san jose has provided quality services to clients by providing them
    with the professional care they deserve. We are a professional and affordable Commercial
    Towing Company. BIG TRUCK TOW provides a variety of services, look below for the list of
    services we offer. Get in touch today to learn more about our heavy duty towing


    Click here to Find tow truck near me

    ReplyDelete
  2. The way you write, you are really a professional blogger. https://eezbatteryreconditioning.com/

    ReplyDelete

  3. This is such an awesome asset, to the point that you are giving and you give it away for nothing.our article has piqued a lot of positive interest. https://ileanbellybreakthrough.com/

    ReplyDelete
  4. Outstanding article! I want people to know just how good this information is in your article. Your views are much like my own concerning this subject. I will visit daily your blog because I know. It may be very beneficial for me. the underground fat loss manual reviews

    ReplyDelete
  5. This is such an awesome asset, to the point that you are giving and you give it away for nothing.our article has piqued a lot of positive interest. https://mikeacnenomore.com/

    ReplyDelete
  6. Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that. fat burning fingerprint diet

    ReplyDelete
  7. Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that. beta switch reviews

    ReplyDelete
  8. Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that. https://the28dayketochallenge.com/

    ReplyDelete
  9. Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that. rick kaselj

    ReplyDelete
  10. Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that. https://yogaburnmag.com/

    ReplyDelete
  11. There is noticeably a bundle to know about this. I assume you made certain nice points in features also . product reviews website

    ReplyDelete
  12. I love it here. Keep sharing your good vibes. I love them Are you also searching for Online mathematics help? we are the best solution for you. We are best known for delivering cheap assignments to students without having to break the bank

    ReplyDelete
  13. Thankful to you for your post, I look for such article along time, today I find it finally. this post give me piles of instigate it is to a marvelous degree relentless for me. vivo V19 (Indonesia) Price

    ReplyDelete
  14. stunning, great, I was wondering how to cure skin break out ordinarily. likewise, found your site by google, took in an extraordinary arrangement, now i'm fairly clear. I've bookmark your site and moreover incorporate rss. keep us invigorated. Oppo A54 Price In Pakistan

    ReplyDelete
  15. Glad to visit your blog. Thanks for great post that you share to us..

    ReplyDelete

Blogroll

Popular Posts