ofhouse / angular-forms-child-components

Example Angular app which demonstrates how to use child components in an reactive form context.

Home Page:https://codesandbox.io/s/github/ofhouse/angular-forms-child-components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example Angular app

This app is an example how to use child components in Angular reactive forms.

You can also checkout the code online in CodeSandbox:

View it on CodeSandbox

Idea

The idea is to to create a formGroup in the main view and pass it to it's child components. The child components then create a new form by themselves and initialize it with the passed formGroup input value from the main view.

To learn more about this technique you can checkout this article by Josh Hicks:

Using Child Components in Angular Forms

Author


Felix Haus

WebsiteTwitter

About

Example Angular app which demonstrates how to use child components in an reactive form context.

https://codesandbox.io/s/github/ofhouse/angular-forms-child-components


Languages

Language:TypeScript 66.7%Language:JavaScript 20.2%Language:HTML 12.2%Language:CSS 0.9%