Questions tagged [ng-container]

79 questions
18
votes
4 answers

How to load the ng-template in separate file?

In below sample, I have used ng-template like below and it is working fine. Sample link: click here
Kumaresan Sd
  • 1,399
  • 4
  • 16
  • 34
14
votes
2 answers

What IS ng-component in Angular?

There are two very similar named directives (or attributes) in angular ng-component and ng-container If you put ng-component instead of ng-container you'll get all kinds of weird behavior - such as automatic insertion of a . I've…
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
6
votes
3 answers

Is there some way to bind a click to a ng-container?

I've got a component made of a ng-container, I would like to bind a click on it. (click) doesn't do the job. Is there another way to do it ?
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
6
votes
2 answers

Angular 4 Dynamic form with nested groups

I want to generate a reactive form from the tree structure. Here is the code that creates the form items (form groups and controls). For the controls nested in form group it I use a recursive template. import { Component, Input, NgModule } from…
4
votes
1 answer

Child doesn't render template passed by parent

Well, this is my parent component where I am trying to pass the template nodeTemplate to the child ils-tree
Aakash Verma
  • 3,705
  • 5
  • 29
  • 66
4
votes
1 answer

how do I change width of ng-container inside mat-table

The width of columns(ng-container) inside the mat-table is equally divided. Is there a way I can adjust based my requirements (contents on column). Ex. In below image, checkbox is taking equal width as other columns which is not what I…
user741825
  • 89
  • 1
  • 5
4
votes
2 answers

Bind to Template Reference Variable inside angular

I have the following markup:
{{column}}
monstertjie_za
  • 7,277
  • 8
  • 42
  • 73
4
votes
1 answer

How to wrap an Angular Component and pass ng-template from outer to inner component

I am using Angular 5 and trying to wrap ng-select in a custom component. My reason is to encapsulate it so it could be easily replaced if needs be. If there is a better way to do this please let me know. I created a custom component and I have…
user1810292
  • 279
  • 6
  • 17
3
votes
2 answers

Angular 11+ MatDialog: inner component's (ngComponentOutlet) html does not trigger

In fact, I'm having more issues with the ngComponentOutlet-embedded component inside the MatDialog. But let's start here. What I'm building I want to display an arbitrary Component inside a MatDialog. I've found a way, but while it works on Angular…
3
votes
1 answer

How to pass data to ng-template from conditional ng-container

My data model: export class Contact { constructor( public type: ContactTypes, public name: string, public link?: string ) { } } export enum ContactTypes { Address = 'address-card-o', Phone = 'phone', Mobile = 'mobile', …
Sergii
  • 7,044
  • 14
  • 58
  • 116
3
votes
1 answer

how to use selector similar to ng-container in angular-4.x

I'm using angular-4.x and inside component I'm using some 'abc' Selector as below: @Component({ selector: "Abc", templateUrl: "Abc.html", styleUrls: [ "Abc.css" ] }) but "Abc" tag is present in DOM as well but I want it to behave as…
Akhilesh Kumar
  • 9,085
  • 13
  • 57
  • 95
2
votes
1 answer

Display 2 input fields within ng-container and div side by side in bootstrap

I'm trying to display 2 input fields and a button side by side. Tried many combinations, but still no luck. The code block of the and is below. Can you please help on how to make them on the same row ide by side. Thanks so much Code:
Harry
  • 546
  • 6
  • 22
  • 50
2
votes
0 answers

eCharts Tooltip Formatter - Possible to use Angular ng-container?

I want to include ng-container in my eCharts Tooltip formatter. I found the following link (How to format the tooltip value in echart (angular)) and it is working to create a simple HTML output, but I want to create something more sophisticated in…
snibbo
  • 179
  • 11
2
votes
0 answers

Angular ngTemplate, ngTemplateOutlet, ngContent: Select Contents of Template

Angular ngTemplate, ngTemplateOutlet, ngContent: Select Contents of Template I have 2 components: AppComponent () and ModalComponent (). Nothing is special about these other than: ModalComponent leverages…
2
votes
0 answers

Dynamic Tagging in ng-template and use with ng-container *ngTemplateOutlet

I have an *ngFor which iterates through users like:
(is there a way to do that...?) --------call…
Iraklis Bekiaris
  • 1,163
  • 15
  • 43
1
2 3 4 5 6