how to write a simple http intercept?
问题 Can somebody explain what is wrong with the following? void main() { var intercept = new HttpInterceptor(); intercept.response = (HttpResponse response) => print('we have a response'); Injector injector = ngBootstrap(module: new MyModule()); var interceptors = injector.get(HttpInterceptors); interceptors.add(intercept); } Thanks in advance EDIT: And here is how I do an http request (from inside a directive): @NgDirective( selector: '.my-selector') class MyDirective implements NgAttachAware {