search

Home  >  Q&A  >  body text

angular.js - How to get the css attributes in the class in the custom tag in angularjs

How to get the css attribute in the class in the custom tag in angularjs

黄舟黄舟2801 days ago617

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-15 16:58:49

    Two choices, one is

     document.getElementsBy

    Id("your_id");
    Then peel the garlic, of course getElementsByClassName belongs to the same solution as this.

    The second one, if it is in the directive, it is also possible

    angular.element(this)

    Then peel the garlic...

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 16:58:49

    This is not possible. I found a way. You can have a scope in the custom tag. Use $rootScope to get the attributes and then share them, so that they can be used outside the custom tag.

    reply
    0
  • Cancelreply