angular2-ngcontent Questions
5
Solved
We are developing a corporate component library which should provide Material Designed Angular Components. So the users of this library are not supposed to use e.g. Angular Material directly but ra...
Lorou asked 17/2, 2018 at 11:17
3
Solved
My child-component looks like:
...
@Component({
selector: '[child-component]'
templateUrl: './child.template.html'
})
...
and my parent template like:
<span child-component [someInput]="12...
Gridley asked 4/9, 2018 at 14:56
3
I was just learning the use of Transluction in angular2 from this tutorial:
https://scotch.io/tutorials/angular-2-transclusion-using-ng-content
I was able to use the <ng-content> tag ...
Galosh asked 24/1, 2017 at 10:17
2
Solved
What is the difference between ng-content and ng-template, and what are some different use-cases for each of them?
Nefen asked 28/11, 2020 at 18:57
3
I am going through this tutorial to comprehend angular 2's ng-content. I want to capture event which is triggered on ng-content. I have following component:
@Component({
moduleId: module.id,
s...
Vivienne asked 2/3, 2017 at 11:32
1
We have some arrays like:
heroes: Hero[];
villains: Villain[];
...
puppies: Puppy[]
and a template like
<p *ngFor="let individual of heroes">
{{ individual.name }} - {{ individual.mobil...
Lawman asked 22/8, 2018 at 8:0
1
Solved
I have created a tab view, with the following structure:
<tabs>
<ul #getVCRefHERE >
<li>tab1</li>
<li>tab2</li>
</ul>
<tab>
<ng-content>...
Djerba asked 12/9, 2017 at 16:41
1
Solved
I'm trying to create a tab component using bootstrap.
<app-tabs>
<app-tab [label]="'label1'">Description 1</app-tab>
<app-tab [label]="'label2'">Description 2</app-tab...
Subserve asked 27/11, 2017 at 0:23
2
Solved
Hi I want some conditional implementation of ng-content
e.g.
<div>
<ng-content select="[card-icon]"></ng-content>
</div>
<div #body>
<div *ngIf="description.chil...
Ruthenian asked 20/11, 2017 at 6:32
2
Solved
I'm trying to load different 'parent' components and inject route content into these different parent components by targeting ng-content in each parent component. Essentially, each parent component...
Yiyid asked 23/7, 2017 at 5:16
1
Solved
I'm pretty new in angular2 and I'm trying to make a small angular component called "grid" that simply rearranges its content using transclusion.
Its template
grid component template (grid.compon...
Arethaarethusa asked 15/6, 2017 at 10:17
3
Solved
depending on the value of a (boolean) class variable I would like my ng-content to either be wrapped in a div or to not be wrapped in div (I.e. the div should not even be in the DOM) ... Whats the ...
Crampon asked 11/1, 2017 at 14:53
3
Solved
plnkr demo here
@Component({
selector: 'my-demo',
template: `This is <ng-content select=".content"></ng-content>`
})
export class DemoComponent { name = 'Angular'; }
@Component({
s...
Backchat asked 1/5, 2017 at 11:35
4
Solved
My simplified goal is to build a component which is a list with item template. E.g.:
<list>item</list>
Here is my code:
import {bootstrap} from 'angular2/platform/browser';
import {...
Blip asked 29/4, 2016 at 21:42
0
I am successfully using <ng-content></ng-content> to show a component in a grandchild as answered here: Father-to-son component tree with guest component, but now I would like to use @C...
Couture asked 13/3, 2017 at 23:47
1
Solved
I have the following piece of markup:
<group-header [isOpen]="true">
<div *ngIf="isOpen">{{'PRICE' | resource}}</div>
</group-header>
group-header's template looks like ...
Vidavidal asked 24/2, 2017 at 12:53
2
Solved
I tried to include css for children element included in a component via ng-content. It seems to be not implemented yet in Angular 2 or maybe someone has got a solution except to put css in a genera...
Albacore asked 23/2, 2017 at 12:40
2
Solved
Common menu usage case
<menu>
<menu-item1></menu-item1>
<menu-item2></menu-item2>
<menu-item3></menu-item3>
</menu>
menu template
<div *ngI...
Brachypterous asked 14/1, 2017 at 17:33
1
Given the following component (with selector my-template):
<form #theForm="ngForm">
<ng-content></ng-content>
</form>
and use it like this:
<my-template>
<inp...
Mohammedmohammedan asked 13/12, 2016 at 11:44
3
Solved
I'm using Angular 2.0.1.
I have a component that can take in any other component via <ng-content> -- this works great.
The issue I run into is when I want to reference the injected componen...
Diffuser asked 3/11, 2016 at 22:27
1
Solved
What I'm trying to achieve is a generic component that is bound to an array of arbitrary objects that allows adding and removing rows dynamically when the view of each row is also arbitrarily defin...
Neocene asked 27/7, 2016 at 7:57
1
© 2022 - 2024 — McMap. All rights reserved.