小编lpd*_*lpd的帖子

如何在Angular 6中加密和解密

登录响应

{code:200,id:4,msg:"success",user:"Sourav"}

我有一个问题,我想将本地存储中的ID和用户存储为加密格式.如何使用Angular 6进行操作?

javascript angular

8
推荐指数
3
解决办法
2万
查看次数

如何在Angular 6中使用http delete()

myService.ts

  import { Injectable } from '@angular/core';
  import { Http, Response,Headers,RequestOptions } from '@angular/http';
  import { Observable } from 'rxjs';
  import 'rxjs/Rx';
  import{Router} from'@angular/router';
  import 'rxjs/add/operator/map';
  @Injectable()
  export class ManageJobDeleteService{
    constructor(private http: Http,private router:Router){};
    DeleteRequestToAPI(post_jobs_id:string){
       let body = JSON.stringify({post_jobs_id:post_jobs_id});
       let headers = new Headers({ 'Content-Type': 'application/json'});
       let options = new RequestOptions({ headers: headers });
        console.log(body);
        console.log(options);
      return this.http.delete('http://127.0.0.1:8000/api/employer/post_jobs/',body,options)//HERE I AM GETTING ERROR
      .map(this.extractData)
      .catch(this.handleError);
    }
   private extractData(res: Response){
      let body = res.json();
      console.log(body);
      return body || [];   
    }
    private handleError …
Run Code Online (Sandbox Code Playgroud)

rest typescript angular angular6

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

angular ×2

angular6 ×1

javascript ×1

rest ×1

typescript ×1