Questions tagged [angular2-ngcontent]
88 questions
0
votes
0 answers
ion-select not updated when is inside then ng-content of custom component
I've a ionic page with a ion-select inside a custom component that shows itself when a flag isLoading is true.
The ion-change callback makes a network request using an Observable, the first operation the callback does is setting the isLoading flag…
![](../../users/profiles/10955903.webp)
david
- 1
- 1
0
votes
0 answers
Angular does not render html in typescript
I code some html in my component like below. I add span with specific class in renew innerHTML of an element:
nodes = this.getAllTextnodes(this.textarea.nativeElement);
x1 = nodes[0].data.substring(0, this.characterLimit - 1);
…
![](../../users/profiles/10495437.webp)
Mohandes
- 171
- 1
- 5
- 12
0
votes
1 answer
Angular 2+ Content Projection and Component property binding
I'm stuck on a hard stuff about Angular Content Projection.
I would like to project a component A into another one B and bind some properties on the component A.
For example,
I have a SwitchButton component (with several choices). I want this…
![](../../users/profiles/10424337.webp)
Canopy
- 41
- 5
0
votes
1 answer
Angular 4,5 how to detect for ng-content in child component to be finished changing
I have a parent component like this. So number of items in menu depends on model. And model changes.
![](../../users/profiles/6534957.webp)
Jerzy Gruszka
- 1,149
- 2
- 10
- 19
0
votes
0 answers
How can you reuse an Angular reactive form inside other Angular reactive forms to stay DRY?
I have two forms in my Angular app: Form A (form for site admin) and Form U (form for standard user).
Form A includes all of Form U but adds a few more input fields.
I want to write Form U only once and use it both in Form U and Form A rather than…
![](../../users/profiles/1675976.webp)
CodyBugstein
- 17,496
- 50
- 159
- 312
0
votes
0 answers
passing array item back to component (ng-content) (angular) (custom component)
This might be a simple projection recipe, but I haven't been able to find the answer,
the simple question is
I have a loop with an ng-content in it,
so lets say
custom-component
has this in its view file
…
![](../../users/profiles/7154885.webp)
Liam Bayly
- 1
- 2
0
votes
2 answers
Programmatically set content of a component in angular 2
I have created a simple window component that has a header and shows some content. My app will only ever show one window at a time, so I placed it in the root of my app and only change its contents when needed.
As I need to be able to set the window…
![](../../users/profiles/8970467.webp)
Catatafish
- 3
- 4
0
votes
1 answer
Passing template to swimlane/ngx-datatable
I am using swimlane/ngx-datatable component and I developed a wrapper for ngx-datatable.
Wrapper:
Use:
…
![](../../users/profiles/2450935.webp)
puppeteer701
- 1,019
- 2
- 13
- 30
0
votes
1 answer
Trying to reduce code repetition in my code base
I'm trying to reduce code repetition in my code base, where I have the following pattern in my HTMLs:
{{entityFormName}}
0
votes
1 answer
How to add [disabled]='!f.valid' to submit button using ng-content in angular 4?
Have a form component which contains email, password field and submit button is passed through ng-content so that for login Form 'Login' button can be showed and for register form 'Register' button can be showed. Form component template code:
0
votes
0 answers
Angular 2 attribute component is wrapping the template in the input tag
I am attempting to create a DatePicker component in Angular 2.
I would like this to be an attribute component, so my html would look like:
The problem is when rendering the template, it wraps it…
![](../../users/profiles/495247.webp)
Scottie
- 10,410
- 17
- 62
- 103
0
votes
2 answers
kendo component encapsulation template/component use
Is is possible to transclude custom column definitions via ng-content or TemplateRef or similar? I've been testing via Kendo UI Grid plunker available at site (http://www.telerik.com/kendo-angular-ui/components/grid/) as well as Angular2 child…
![](../../users/profiles/7358772.webp)
Kent
- 21
- 6
0
votes
1 answer
How to bind ngStyle to ng-conent in angular2
I try to bind ngStyle to ng-content, it doesn't work, see below example:
I search on internet only find below solution,
::content >>> panel-one {width:50px}
=>from…
![](../../users/profiles/4949599.webp)
Ivan zhao
- 1
- 3