I am trying to build a form using form controller
registerForm = new FormGroup
Here am getting registerForm property cannot find..please help me am new to this
import { Component, OnInit } from '@angular/core';
import{FormGroup, FormControl}from '@angular/forms'
@Component({
selector: 'my-app',
templateUrl:'app.component.html'
})
export class AppComponent implements OnInit//error here
{
ngOninit()
{
registerForm = new FormGroup({//error
first_name: new FormControl(),
last_name: new FormControl(),
phone: new FormControl(),
email: new FormControl(),
address: new FormGroup({
street: new FormControl(),
zip: new FormControl(),
city: new FormControl()
})
});
}
}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pradeep ShetPosted Apr 11, 2017, 2:58 PM