Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. signUpForm: any;
  2. result: any;
  3.  
  4. constructor(
  5. private formBuilder: FormBuilder,
  6. private accountService: AccountService,
  7. private router: Router
  8. ) {}
  9.  
  10. ngOnInit() {
  11. this.signUpForm = this.formBuilder.group({
  12. username: ['', [Validators.required]],
  13. password: ['', [Validators.required]],
  14. fullName: ['', [Validators.required]],
  15. email: ['', [Validators.required]]
  16. });
  17. }
  18.  
  19.  
  20.  
  21. save(event: any) {
  22. this.accountService.create(this.signUpForm.value).subscribe(data => {
  23. if(data.count == 0) {
  24. this.router.navigate(['/login']);
  25. } else {
  26. this.result = data
  27. }
  28. });
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement