Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit } from '@angular/core';
- import {AuthService} from '../../services/auth.service';
- import {Router} from '@angular/router';
- import {FlashMessagesService} from 'angular2-flash-messages';
- @Component({
- selector: 'app-login',
- templateUrl: './login.component.html',
- styleUrls: ['./login.component.css']
- })
- export class LoginComponent implements OnInit {
- username: String;
- password: String;
- constructor(
- private flashMessage: FlashMessagesService,
- private authService: AuthService,
- private router: Router) { }
- ngOnInit() {
- }
- onLoginSubmit(){
- console.log(this.username);
- const user = {
- username: this.username,
- password: this.password
- }
- this.authService.authenticateUser(user).subscribe(data => {
- console.log(data);
- });
- }
- }
Add Comment
Please, Sign In to add comment