I want to create a component in Angular2 which will show a table with some 
data(lets assume sales data of different product P1 and P2). Along with the 
table I want to allow user to choose option between different type of 
graphs and based on the graph selection I want to show the graph of shown 
data in a container below the data table.

I have created a component(lets call it Main) which have <data-table> as 
one component, A radio group showing graph type. Now for 10 different graph 
type, and I have created 10 different graph component for these 10 types.

Approach:
I can put all ten component in Main component and based on user selection I 
show the respective graph component. But this approach would be too costly 
since Main component shadow dom will have all the graph component. It also 
present problem If I allow user to select from a range of time and update 
the shown graph using binding as it will result in updating other graph 
which are not being shown.

Is there any approach where I can put a generic container in Main component 
and inject a list of graph component in main component and based on user 
selection I put the selected graph component in that container. Putting in 
the container should not disrupt binding.

Just to summarize, I want to find a way to dynamically put the component in 
a another component. Ideally in Composite Design Pattern it should be 
fairly easy to determine component in runtime.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to