import { Injectable } from "@angular/core";
import { Observable, BehaviorSubject, concat } from "rxjs";
tttttttttttttttttttttttt
import { map } from 'rxjs/operators';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class DataService {
constructor(private http: HttpClient) {
}
private token: string = "";
private tokenExpiration: Date;
public store: string = "";
public user: string = "";
public login(creds) {
this.store = creds.strNum;
this.user = creds.empID;
return this.http.post("/Account/CreateToken", creds)
.pipe(map(response => {
let tokenInfo = response;
this.token = tokenInfo["token"];
this.tokenExpiration = tokenInfo["expiration"];
return true;
}));
}
}