Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- postData(credentials,type){
- return new Promise((resolve, reject) =>{
- let headers = new HttpHeaders();
- this.http.post(apiUrl+type, JSON.stringify(credentials), {headers: headers}).
- subscribe(res =>{
- resolve(res.json());
- }, (err) =>{
- reject(err);
- });
- });
- }
- public postData(credentials: Object, type: string): Promise<any> {
- return new Promise((resolve, reject) => {
- this.http.post(apiUrl + type, credentials).subscribe(
- response => {
- resolve(response);
- },
- exception => {
- reject(exception);
- }
- );
- });
- }
Add Comment
Please, Sign In to add comment