Linked Questions
20 questions linked to/from Angular2 nested template driven form
2
votes
1
answer
1k
views
How to get the template driven form data on parent component submit button [duplicate]
I have a child component in which I have rendered the text form input controls. My submit button is rendered in parent component so while submitting the form I am getting the empty data.
parent-...
37
votes
2
answers
32k
views
Angular 2: Form containing child component
I have component which has a form and some child components within the form. The child components are created using *ngFor and each child contains input elements. Angular2 compiler is giving errors ...
17
votes
4
answers
29k
views
Angular 4 - Error: formControlName must be used with a parent formGroup directive
I am adding form input fields using component -
engine-add-contact-form.html
<form (ngSubmit)="onSubmit()" [formGroup]="contact_form">
<md-tab-group>
<md-tab label="Form">
...
12
votes
2
answers
8k
views
Form in form. Can there be inheritance of form controls?
I have two components: ParentComponent and ChildComponent:
parent.component.ts
<form #form="ngForm" (ngSubmit)="onSubmit(form)" novalidate>
<input type="text" name="firstControl" [(...
5
votes
2
answers
4k
views
Angular 4 Template Driven nested form validation?
I have 2 components, a parent component and a child component. The parent component contains the following:
<form (ngSubmit)="saveWebsite();" #adminForm="ngForm">
<input type="...
7
votes
1
answer
3k
views
ngTemplateOutlet - Angular 5 nested template driven form
I have a ng-template which is being passed on from one of my component and i have a placeholder to accept the passed on ng-template onto my component as shown below in ngTemplateOutlet.
<div>
&...
1
vote
3
answers
12k
views
Cannot find control with name:
I have a quite complicated form which I want to break down into individual components. Here is my base form (only taken example fields), I'm using FormBuilder:
ngOnInit() {
this.predictorQuestion = ...
3
votes
1
answer
5k
views
Angular 2 or 4: How to add multiple instances of a child component
Note: I have seen several questions like my title, but they don't solve my problem. Like:
Angular2 Parent Component with multiple instances of child component (just code error)
Instance Angular 2 ...
0
votes
1
answer
4k
views
angular component with multiple inputs and validation (required)
I want to create a custom component with multiple input controlls which I can use in other components forms including the validation. The only examples I could find show how to create a simple ...
1
vote
1
answer
3k
views
Angular2 ng-bootstrap nav with nested template-driven form
I've been using the answers (and the article within) from Angular2 nested template driven form to use child-nested form controls. Which is great until I try to use the child component within a Ng-...
2
votes
1
answer
2k
views
Angular (4): transfer ngForm & ngModelGroup from parent to child and use form validation
I'd like to transfer my ngForm and ngModelGroup from parent component to child component and also use form validation functionality in the child component.
Parent component.html:
<md-step [...
2
votes
1
answer
1k
views
Cloned elements cannot be submitted in Angular4
I have a template with two fields for.eg name and age, that needs to cloned and appended to the same container. I achieved this using the following code.
html file
<ng-template #tpl>
<div ...
4
votes
1
answer
1k
views
Nested ReactiveForms Controls don't get ngSubmit event
While building more complex reactive forms I stumbled across an issue while nesting reactiveFormGroups more than once.
So I've got two scenarios:
Form Component -> Form Partial Component -> Custom ...
0
votes
1
answer
1k
views
Angular child form field validation
I have some existing code that's structured more or less like this:
<!-- my-form.html -->
<form ngNativeValidate>
<my-other-component></my-other-component>
<button ...
3
votes
2
answers
812
views
viewChild inside a form does not trigger it from pristine
Here's the situation:
parent.component.html
<form #someForm >
<input type="text" name="title" [(ngModel)]="parentVar" />
<child-component />
<input type="submit" [disabled]...