I'm currently working on creating a custom directive in Angular 4 to enable resizing of a div.
Here's the HTML code snippet:
<div class="super-parent">
<div class="parent">
My Div content
<div class="child" resizer></div>
</div>
</div>
And here is the method for the directive:
resizer(offsetX: number) {
this.width += offsetX;
this.el.nativeElement.parentNode.style.width = this.width + "px";
}
Prior to setting the parent node's width, I'm searching for a way to determine the width percentage of the super parent div. Is there a way to achieve this?
Appreciate any assistance in advance...