Ich habe ein Problem mit Angular 2 + Typescript, immer wenn ich versuche zu bauen, es zeigt mir die gleichen Fehler, habe ich alles versucht, einschließlich <Referenz> Tags in den Dateien. Was ist zu tun?Angular 2: Kann Modul 'angular2/core' nicht finden
(7,26): error TS2307: Cannot find module 'rxjs/Rx'./Users/macbook/workspace/rss/src/app/services/rootscope.ts (8,46): error TS2307: Cannot find module 'angular2/core'./Users/macbook/workspace/rss/src/app/services/rootscope.ts (17,48): error TS2304: Cannot find name 'Observer'./Users/macbook/workspace/rss/src/app/services/api.ts (6,26): error TS2307: Cannot find module 'angular2/core'./Users/macbook/workspace/rss/src/app/services/api.ts (7,27): error TS2307: Cannot find module 'angular2/http'./Users/macbook/workspace/rss/src/app/services/api.ts (15,13): error TS2339: Property 'http' does not exist on type 'API'./Users/macbook/workspace/rss/src/app/services/api.ts (19,20): error TS2339: Property 'http' does not exist on type 'API'./Users/macbook/workspace/rss/src/app/services/api.ts (23,20): error TS2339: Property 'http' does not exist on type 'API'../src/app/app.ts (6,25): error TS2307: Cannot find module 'angular2/platform/browser'../src/app/app.ts (7,25): error TS2307: Cannot find module 'angular2/core'../src/app/app.ts (8,47): error TS2307: Cannot find module 'angular2/http'.
rootscope.ts
/// <reference path="../../../node_modules/reflect-metadata/reflect- metadata.d.ts" />
/// <reference path="../../../node_modules/angular2/typings/browser.d.ts" />
/// <reference path="../../../node_modules/angular2/core.d.ts" />
/// <reference path="../../../node_modules/angular2/http.d.ts" />
/// <reference path="../../../node_modules/rxjs/Rx.d.ts" />
import {Observable} from "rxjs/Rx";
import {Injectable,EventEmitter,Output} from "angular2/core";
@Injectable()
export class ROOT_SCOPE {
data: any;
dataChange: Observable<any>;
@Output dataChangeObserver: EventEmitter=new EventEmitter();
constructor() {
this.dataChange = new Observable((observer:Observer) => {
this.dataChangeObserver = observer;
});
}
set(data:any) {
this.data = data;
this.dataChangeObserver.next(this.data);
}
}
Welche Angular2-Version verwenden Sie? Für => RC.x brauchst du '@angular/...' anstelle von 'angular2/...' –
Mit welcher Version von angular2 hast du es zu tun? – micronyks
Es ist 2.0.0-beta.0 –