///<reference path="../../../typings/angular2/angular2"/>
import {Component, View, bootstrap} from "angular2/angular2";
import { Router } from "angular/router";
import {Login} from "../login/login";
@Component({
selector: "my-app",
})
@View({
template: "<login></login>"
})
// Component controller
export class FreshairAppComponent {
constructor(router:Router) {
router
.config(["/login",Login,"login"])
.then(()=>router.navigate("login"));
}
}
bootstrap(FreshairAppComponent);
Output di Typescript (1.5):
/ usr / bin / tsc --sourcemap / home / larry / Projects / FreshAir2 / src / components /app/app.ts --target es5 --m commonjs --emitDecoratorMetadata --outdir / home / larry / Projects / FreshAir2 / / js pubblici
/home/larry/Projects/FreshAir2/src/components/app/app.ts(4,24): errore TS2307: impossibile trovare il modulo esterno "angolare / router".
Cosa mi manca?
risposte:
1 per risposta № 1Solo un'ipotesi: cambia angolare in angolare2.
import { Router } from "angular2/router";