codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Follow publication

Angular dynamic forms: ng-switch approach

Juan Camilo Giraldo Chaverra
codeburst
Published in
6 min readApr 3, 2019

Angular approaches

Template driven vs Model Driven

Getting Started

Creating our dynamic-form component

app.component.html
form-data.ts
app.module.ts
dynamic-form.component.ts
dynamic-form.component.html

Mock Data

mock-data for creating our dynamic form
app.component.ts

Using ngSwitch

ControlType was just a generic name, you can use whatever name you want to define for the properties of your dynamic form.

You can check the full source code on Github

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Responses (5)

Write a response