Topic: Angular collapse not resizing correctly
Alberto pro asked 7 years ago
salman1793 pro answered 6 years ago
Alberto pro answered 7 years ago
<button class="btn btn-primary waves-light" type="button" (click)="test.toggle()" mdbRippleRadius>
Toggle collapse
</button>
<div class="" [mdbCollapse]="isCollapsed" #test="bs-collapse">
<p>{{card.userComment}}</p>
</div>
Dawid Adach pro commented 7 years ago
Dear Alberto, could you please share this sample via email : d.adach@mdbootstrap.com or some pastebin ? I am not sure what card.userComment is aboutAlberto pro commented 7 years ago
The angular component exposes an array collection of objects as in data = Array. It is populated in ngInit by calling a service and subscribing to the returned Observable collection. The CardObject is a POCO that exposes several properties including userComment. Does this clarifies a bit? Cheers, AlbertoDawid Adach pro commented 7 years ago
Dear Alberto, can you call resize() after populating comments ? What is the result?Dawid Adach pro answered 7 years ago
public resize():void { constcontainer=this._el.nativeElement; this.maxHeight=this._el.nativeElement.scrollHeight; this._renderer.setElementStyle(container, 'height', this.maxHeight+'px'); }
@ViewChild('test') myCollapse; [...]
this.myCollapse._el.nativeElement.innerHTML='Anim pariatur ....'; this.myCollapse.resize();
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Dawid Adach pro commented 7 years ago
Hi Alberto, looking into this. Will come back to you as soon as we will get more information on that. Could you please meanwhile provide us with the input data which you use? Are they anyhow specific? Long strings etc?Alberto pro commented 7 years ago
Hi, it's just a paragraph of user comments retrieved with an observable e.g. Toggle collapse {{card.userComment}}