我正在尝试创建一个登录应用程序使用angular2http与承诺。issue is before printing the response object in extractData function in service, "Got response" consoleLogin component
import { Router} from '@a
$es6$promise$$internal$$tryCatch (http://localhost:3000/lib/angular2-polyfills.js:1511:16)
at lib$es6$promise$$internal$$invokeCallback (http://localhost:3000/lib/angular2-polyfills.js
我需要在success/then函数中拒绝$httppromise调用。我可以看到两个选项: 1)抛出一个错误--这会占用控制台;2)使用单独的延迟调用并拒绝该调用。有没有更干净/更简洁的方法?错误: throw new Error('Booh');使用$q:$http.get(url}.then(function
/angular2/bundles/angular2-polyfills.js:111:19)
at lib$es6$promise$$internal$$tryCatch (http://localhost:9000/node_modules/angular2/bundles/angular2-polyfills.js
(http://127.0.0.1:8888/angular2demo/angular2.sfx.dev.js:11797:22)
at http://127.0.0.1:8888/angular2demo$promise$$internal$$tryCatch @ angular2-polyfills.js:468lib