Joseph Curatola has worked for four companies over the past 20 years. From 2019 to present, they have been an Inside Sales Specialist at Kuiken Brothers Company, Inc. From 2010 to 2019, they were Safety Manager at Backhaul Engineering LLC. From 2003 to 2010, they were a foreman at ltw. From 1999 to 2003, they were a Technical Services at pascack datacom.
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { AuthService } from '../../services/auth.service';
import { ToastrService } from 'ngx-toastr';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
loginForm: FormGroup;
constructor(
private fb: FormBuilder,
private authService: AuthService,
private router: Router,
private toastr: ToastrService
) { }
ngOnInit() {
this.loginForm = this.fb.group({
email: ['', [Validators.required, Validators.email]],
password: ['', Validators.required]
});
}
login() {
const val = this.loginForm.value;
if (val.email && val.password) {
this.authService.login(val.email, val.password)
.subscribe(
(res) => {
if (res) {
this.router.navigateByUrl('/');
}
},
(err) => {
this.toastr.error(err.error.message);
}
);
}
}
}
Links
Sign up to view 0 direct reports
Get started