Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Injectable } from '@angular/core';
- import { Http, Headers, RequestOptions } from '@angular/http';
- @Injectable()
- export class UserService extends ServiceBase {
- apiUrl: string;
- private contentHeaders = new Headers();
- constructor(private http: Http) {
- super();
- this.apiUrl = appConfig.apiBaseUrl + '/users';
- }
- login(user: User) {
- this.contentHeaders.append('Accept', 'application/json');
- this.contentHeaders.append('Content-Type', 'application/json');
- return this.http.post(
- this.apiUrl+'/sign_in',
- JSON.stringify({user: user}),
- {headers: this.contentHeaders}
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement