Get element parent height inside directive in AnguarJS

后端 未结 2 1152
予麋鹿
予麋鹿 2021-01-02 22:14

How do you get and set the parent height from an element from inside a directive?

This is what I have now, obviously it\'s not working.

var vAlign =          


        
2条回答
  •  长发绾君心
    2021-01-02 23:08

    e.parent is a function, so you must call it as such:

    e.parent().height(1200);
    

    Further, if you do not load jquery on the page, you will have to use

    .css('height', '1200px')
    

    instead, as jqLite does not include .height

提交回复
热议问题