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…
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); …
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…
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. ... some data .... some data
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…
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
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…
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:
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:
Aamir
  • 91
  • 1
  • 11
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…
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…
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…
Ivan zhao
  • 1
  • 3
1 2 3 4 5
6