johnpapa / johnpapa/lite-server
Issues With Lite-server
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
HI, i am trying to access a Restful api through a service, and after that i try to print the JSON object into the console. But i have errors:
Here is my Service:
import {Injectable} from 'angular2/core';
import {Http, Headers} from 'angular2/http';
import {Observable} from 'rxjs/Observable';
import 'rxjs/Rx';
@Injectable()
export class KontenService {
```
private _creationConfig = "http://137.226.134.216:8080/AccDex/api/";
constructor(private _http: Http, private _header_plain: Headers,private _header_form: Headers ){
this._header_plain.append('Content-Type', 'text/plain');
this._header_plain.append('Accept', 'application/json');
this._header_form.append('Content-Type', 'application/x-www-form-urlencoded');
this._header_form.append('Accept', 'application/json');
}
accgetAll(): Observable {
return this._http.get(this._creationConfig + "domain/konten", {
headers: this._header_plain
}).map(res => res.json());
}
```
}
i simply call this method in my component, subscribe to it and all. But i got some mistakes after the compilation:
angular2.dev.js:23514 EXCEPTION: Cannot resolve all parameters for Headers(?). Make sure they all have valid type or annotations.BrowserDomAdapter.logError @ angular2.dev.js:23514
angular2.dev.js:23514 STACKTRACE:BrowserDomAdapter.logError @ angular2.dev.js:23514
angular2.dev.js:23514 Error: Cannot resolve all parameters for Headers(?). Make sure they all have valid type or annotations.
at NoAnnotationError.BaseException [as constructor] ...
can someone help me PLEASE??
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.