我正在使用Angular 2 final和Angular-cli中的可观察对象。
- Angular 2.0.0 final
- angular-cli: 1.0.0-beta.15
- node: 6.3.0
- Mac os: el capitan
package.json中的依赖项:
"dependencies": {
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/router": "3.0.0",
"bootstrap-sass": "^3.3.7",
"chart.js": "^2.2.2",
"core-js": "^2.4.1",
"d3": "^4.2.3",
"d3-tip": "^0.7.1",
"ionicons": "^3.0.0",
"moment": "^2.15.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
}
我的应用在除Safari 9.1.2之外的所有浏览器中都可以正常运行 - 它会将此错误消息抛出到控制台:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4200/Observable.js.map
我尝试在angular_cli.json中导入Rxjs:
"scripts": [
"../node_modules/rxjs/Rx.js"
],
此外,我尝试将rxjs导入到app.module.ts和工作组件中,如下所示:
import {Observable} from 'rxjs/Rx';
我一直在遇到同样的错误。
我是做错了什么吗? 很奇怪只有Safari会遇到这个错误。