Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sss

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;
      }));
  }

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sss
ADD COMMENT
Topic
Name
9+1 =