Linked Questions
249 questions linked to/from Dynamic tabs with user-click chosen components
52
votes
3
answers
12k
views
Dynamic Component selection in Angular2 [duplicate]
Given a model for a page section which contains multiple fields and would be populated with data such like this:
{
"fields": [
{
"id": 1,
"type": "text",
...
2
votes
1
answer
1k
views
Store Angular2 components in a list and render each component in a template [duplicate]
So i have a list of cards (using ionic2), and each card can be one of a number of different types. I was hoping to encapsulate each card in its own component, store them in a list and render them in ...
3
votes
0
answers
557
views
Angular2, loading components dynamically on demand in tabs [duplicate]
At the end of my wits here, so reaching out to smarter people.
I am building a custom "tabbed" CMS system. Problem is with tabs and components. I wish to show a specific component in newly generated ...
0
votes
0
answers
549
views
How to inject component tag using innerHTML directive? [duplicate]
I have some collection of objects, in which each object has the following property:
{
...
component: '<example-component></example-component>'
}
And in my *ngFor directive, I have the ...
0
votes
0
answers
117
views
Angular 2 dynamic component creation [duplicate]
UPDATE: I just had a look at the wrong Plunkr, this Plunkr seems to fit my usecase: http://plnkr.co/edit/GJTLrnQdRDBvZenX59PZ?p=preview
I want to dynamically create components, for example I have the ...
3
votes
0
answers
91
views
rendering a list of components in ngFor angular2 [duplicate]
I have an array of IAnimal with components like dog cat each has its own properties and extends the IAnimal Interface.
Now I want to render all the components in a *ngFor loop from my IAnimal Array ...
228
votes
16
answers
197k
views
How can I use/create dynamic template to compile dynamic Component with Angular 2.0?
I want to dynamically create a template. This should be used to build a ComponentType at runtime and place (even replace) it somewhere inside of the hosting Component.
Until RC4 I was using ...
166
votes
7
answers
127k
views
What is entryComponents in angular ngModule?
I am working on an Ionic app ( 2.0.0-rc0 ) which depends on angular 2 . So the new introduction of ngModules is included. I am adding my app.module.ts. below.
import { NgModule } from '@angular/core';...
146
votes
9
answers
78k
views
Equivalent of $compile in Angular 2
I want to manually compile some HTML containing directives. What is the equivalent of $compile in Angular 2?
For example, in Angular 1, I could dynamically compile a fragment of HTML and append it ...
85
votes
2
answers
117k
views
Dynamically ADDING and REMOVING Components in Angular
The current official docs only shows how to dynamically change components within an <ng-template> tag. https://angular.io/guide/dynamic-component-loader
What I want to achieve is, let's say I ...
34
votes
5
answers
51k
views
Can component invoke a self destroy event
I have a parent component which opens a new component on click of a link, this new component is supposed to have a close button which on close sends a closing message to parent and destroy itself.
We ...
58
votes
4
answers
77k
views
How to place a dynamic component in a container
I want to create dynamic components and insert views of these components to a container.
I think this can be achieved by ViewContainerRef.
But I don't know, can we get ViewContainerRef of any ...
29
votes
7
answers
63k
views
Angular 2 innerHTML (click) binding
I had such a large html menu that I decided to binding to be able to make several submenu dropdown and avoid html code duplication. Parent > child (which is parent too) > child...
For the context : ...
39
votes
5
answers
37k
views
Angular2: Creating child components programmatically
Question
How to create child components inside a parent component and display them in the view afterwards using Angular2? How to make sure the injectables are injected correctly into the child ...
23
votes
4
answers
24k
views
Dynamically adding components in ngFor
I have a "dashboard" that loads configured elements.
Dashboard template has this:
<div class="dash-container" [ngGrid]="gridConfig">
<div *ngFor="let box of boxes; let i = index"
...