Skip to content
Permalink
ffecdcc433
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
45 lines (38 sloc) 1.18 KB
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { CrewMember } from 'src/app/models/CrewMember';
import { AuthService } from 'src/app/auth/auth.service';
@Component({
selector: 'app-account',
templateUrl: './account.component.html',
styleUrls: ['./account.component.scss']
})
export class AccountComponent implements OnInit {
constructor(private authservice:AuthService) { }
form: FormGroup;
crewMember:CrewMember;
ngOnInit() {
console.log("oninit")
this.crewMember = this.authservice.getUser();
this.form = new FormGroup({
Email: new FormControl(null, {
validators: [Validators.required, Validators.email]
}),
FirstName: new FormControl(null, { validators: [Validators.required] }),
LastName: new FormControl(null, { validators: [Validators.required] }),
Crew: new FormControl(null, { validators: [Validators.required] }),
});
}
get Email(){
return this.form.get("Email")
}
get FirstName(){
return this.form.get("FirstName")
}
get LastName(){
return this.form.get("LastName")
}
get Crew(){
return this.form.get("Crew")
}
}