My requirement is to create panel with minimize and maximize button.
based on maximize click of any child component only one should occupy whole parent holder container space and remaining should be hidden.
Where I will have customCompoentHolder , in which I will define number of child component. like below
<my-custom-minmax numOfcompPerRow="2">
<mycomp1></mycomp1>
<mycomp2></mycomp2>
<mycomp3></mycomp3>
</my-custom-minmax>
Here numOfcompPerRow will tell holder component, that how many child component can render per row, if more are there, it should create new row.
And each child component will have own minimize and maximize button.
I tried my-self to get list of child’s and then try to render.
I am able to get list of child by having custom directive or by having base component. And I have use @Contentchilder, and it works properly.
But creating component or rendering component using this.componentFactoryResolver.resolveComponentFactory() doesn’t working for me.
It’s giving me error ERROR Error: No component factory found for undefined. Did you add it to @NgModule.entryComponents?
This is bit hard to understand for me, how to dynamically create component and re-render on different events.
Anyone have idea , how to implement this minimize and maximize functionality. best possible way in Angular
Source: AngularJS
from Angular Questions https://angularquestions.com/2017/09/27/custom-component-holder-which-will-dynamically-create-child-component-with-min-and-max-option/
via @lzomedia #developer #freelance #web
No comments:
Post a Comment