angular-cn/public/docs/js/latest/api/http/IHttp-interface.jade

27 lines
741 B
Plaintext

p.location-badge.
exported from <a href='../http'>angular2/http</a>
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/http/interfaces.ts#L59-L84">angular2/src/http/interfaces.ts (line 59)</a>
:markdown
Provides an interface to provide type information for <a href='HttpFactory-function.html'><code>HttpFactory</code></a> when injecting.
#Example
```
* import {httpInjectables, HttpFactory, IHttp} from 'angular2/http';
@Component({
appInjector: [httpInjectables]
})
@View({
templateUrl: 'people.html'
})
class MyComponent {
constructor(@Inject(HttpFactory) http:IHttp) {
http('people.json').subscribe(res => this.people = res.json());
}
}
```