Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signUpForm: any;
- result: any;
- constructor(
- private formBuilder: FormBuilder,
- private accountService: AccountService,
- private router: Router
- ) {}
- ngOnInit() {
- this.signUpForm = this.formBuilder.group({
- username: ['', [Validators.required]],
- password: ['', [Validators.required]],
- fullName: ['', [Validators.required]],
- email: ['', [Validators.required]]
- });
- }
- save(event: any) {
- this.accountService.create(this.signUpForm.value).subscribe(data => {
- if(data.count == 0) {
- this.router.navigate(['/login']);
- } else {
- this.result = data
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement