Questions tagged [ngtemplateoutlet]

18 questions
7
votes
1 answer

How do I use @ViewChild with an external ng-template (Angular 11)

THE PROBLEM So I have two Angular components, a parent and a child. The parent passes a custom template to the child component, which then hydrates the template with its own data using ngTemplateOutlet. This works well for the most part.…
4
votes
1 answer

ngRouterOutlet and component lifecycle - problem with rendering custom template

Introduction I have created a shared table component that uses Angular Material to render a table based on data and column configurations. The component has default templates for string and number data types, but users should be able to provide…
4
votes
3 answers

Can't bind to 'ngTemplateOutlet' since it isn't a known property of 'ng-container'

It seem to be a problem of the '@angular/common' module and the ivy compiler? Any ideas? Deleting node_modules and updating angular does not have any success. World!…
Marc Reitec
  • 69
  • 1
  • 5
3
votes
2 answers

ViewChild from ngTemplateOutlet coming from parent component

I have a child component which accept a TemplateRef as an @Input and displays it through ngTemplateOutlet. How can I use @ViewChild/@ViewChildren to retrieve components inside the template ? If the template is declared in the same component that…
MHogge
  • 5,408
  • 15
  • 61
  • 104
1
vote
1 answer

in Angular inside ngtemplateoutlet unable to access formcontrol of form control name

i create stackblitz project https://stackblitz.com/edit/new-project-jksckf?file=src%2Fapp%2Fform-field-overview-example.ts,src%2Fapp%2Fform-field-overview-example.html If i pass formcontrolname to ng-template using ngtemplateoutlet it is showing…
1
vote
2 answers

Adding Dynamic Content inside

Hello World

Good Morning

I would like to reuse the reuse template…
1
vote
1 answer

Reusable angular 11 template

I have 2 mat-tabs which each have a table in them, with the same data layout, just a different data source. <-- one data source …
1
vote
1 answer

Template parsing error while using ngTemplateOutlet in Angular

I get the following error while implementing ngTemplateOutlet in my Angular code compiler.js:2420 Uncaught Error: Template parse errors: Parser Error: Missing expected } at column 47 in [searchListing; context: {$implicit:…
Amruta
  • 1,295
  • 1
  • 13
  • 24
1
vote
0 answers

Angular 8 Recursive Form submit for Dictionary (dynamic strucure)

Angular 8 Recursive Form submit for json (dynamic structure). I implemented Angular 8 recursive json(tree) display for dynamic json object but not able to get input data from Angular Form to component on submit since json structure is dynamic. I…
Sail
  • 31
  • 5
1
vote
1 answer

Angular NG-ZORRO. How to split the component into templates

I am just starting with Angular. And I used ng-ZORRO. I copy the example of ng-zorro. It works well. I split it into templates using ng-template and ngTemplateOutlet. It doesn't work. See my example about Menu. Menu1, Menu2 are normal codes. It…
Bartek
  • 81
  • 10
0
votes
1 answer

Use of ngTemplateOutlet and ngtemplate in nested reactive forms in Angular

I'm actually trying to generate reactive forms from data. I would like to create a formGroup and its respective nested forms from json data and also auto generate html form using templates. You will see next the steps i performed with data used and…
0
votes
1 answer

Dynamic template outlet Angular

I am trying to make a dynamic ngTempateOutlet. I tried as follows:
0
votes
1 answer

Form data not shown in component while using ng-template

Iam trying to create a form which i can re-use by using ng-template. But somehow the data is not accessable in the component when I save the form and the function doAddMenuItem(postForm) is called. Here is the form with the ngTemplateOutlet:
Larsmanson
  • 413
  • 1
  • 5
  • 18
1
2
joke date id