각도 2의 앱이 있습니다.rxjs를 Angular 2로 하나의 파일로로드하는 방법은 무엇입니까?
systemjs.config.js :
System.config({
paths: {
'npm:': "libs/"
},
map: {
'rxjs': "npm:rxjs"
}
});
구성 요소 :
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
@Component({
selector: 'test',
templateUrl: './app/test.component.html'
})
export class TestComponent implements OnInit {
constructor(...) { }
ngOnInit() { ... }
}
그리고 꿀꺽 복사는 "libs와"모든 파일을 JS 폴더로 "node_modules/을 rxjs". 나는에 systemjs.config.js을 변경하는 경우
나는 rxjs에서 약 100 요청을 브라우저 콘솔에서(merge.js, fromEvent.js, toPromise.js, ...)
를 참조하십시오
'rxjs': "npm:rxjs/bundles/Rx.min.js"
는 그와 같은 오류를 참조하십시오
localhost/libs/rxjs/bundles/Rx.min.js/operator/toPromise.js Failed to load resource: the server responded with a status of 404 (Not Found)
그것은 퍼포을 개선하는 데 도움이됩니까 nce 만약
node_modules/rxjs/bundles/Rx.min.js 만 사용하면됩니까?
그 단일 파일을 사용하려면 어떻게해야합니까?
어쩌면이 당신을 도울 수 http://stackoverflow.com/questions/40780363/systemjs-loads-many-files-for-rxjs/40788204#40788204 – martin
또한이 https://github.com/systemjs/systemjs/issues/1039하지만 사용중인 SystemJS 버전에 따라 다릅니다. – martin
"정의되지 않은 (router.umd.min.js : 8)"속성 'call'을 읽을 수 없습니다. "라는 오류가 있습니다. 그리고 로컬 Js 파일 대신 Rx.min.js 파일을 사용하려면 어떻게해야합니까? –