I recently upgraded my Angular 2 application to the RC version. Everything was working smoothly until I included HTTP_PROVIDER and created a service.ts file.
However, now I am encountering an error:
(index):14 Error: SyntaxError: Unexpected token <(…)
I have been unable to identify the root cause of this issue. Can anyone offer assistance?
Below is the code snippet from my service.ts file:
/**
* Created by Adjoa on 5/29/2016.
*/
import {Injectable} from "@angular/core";
import {Http,Headers,HTTP_PROVIDERS} from "@angular/http";
import { Headers, RequestOptions } from '@angular/http';
@Injectable()
export class SignInService {
constructor(private _http: Http){}
postData(data:any){
const body = JSON.stringify(data);
const headers= new Headers();
headers.append('Content-Type','application/json');
return this._http.post('https://testing-angular-2.firebaseio.com/datatest.json', body, {headers:headers});
}
}