This repository has been archived on 2026-05-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
PolyNotFound/src/app/pourLes3Roles/page-connexion/page-connexion.component.ts
2021-10-27 01:48:30 +02:00

43 lines
1 KiB
TypeScript

import { Component, OnInit } from '@angular/core';
import {MessageService} from "../../utils/services/message/message.service";
import {Router} from "@angular/router";
@Component({
selector: 'app-page-connexion',
templateUrl: './page-connexion.component.html',
styleUrls: ['./page-connexion.component.scss']
})
export class PageConnexionComponent implements OnInit
{
email: string = ""
password: string = ""
constructor( private messageService: MessageService,
private router: Router) { }
ngOnInit(): void {}
onSeConnecter(): void
{
let data = {
"email": this.email,
"password": this.password
};
this.messageService
.sendMessage('connexion', data)
.subscribe( retour => this.maCallback(retour))
}
maCallback(retour): void
{
if(retour.status === "error") console.log(retour.data)
else {
console.log(retour.data)
//this.router.navigateByUrl( '/search' );
}
}
}