Last active
January 20, 2018 16:57
-
-
Save dasmido/ffa50d9f0c6c8aadbef64849a4e55b51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment