0

There is a simple way to change dynamically an html attribute?
I hide a div with angular scope variable and a ng-hide, but the size of the div still there, how I can change the size of that div?

I tried with:
<div id="bodyContent" ng-hide="showContent" style="height:size"></div>

and

<div id="bodyContent" ng-hide="showContent" style="height:{{size}}"></div>

2

1 Answer 1

1

You must use ng-style

<div id="bodyContent" ng-hide="showContent" ng-style="{'height':size}"></div>

DEMO

Sign up to request clarification or add additional context in comments.

1 Comment

nothing saves you have to, works using style also plnkr.co/edit/ZmoWbhSIDj502Dqp3fhh?p=preview ..may not be practical but it does work

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.