私はtypescriptで小さなテストangular2アプリケーションを実行しました。エラーはありませんが、生成されたjsファイルはロードされません。ここに私のコードです。Typescriptは動作していないようですが、コードにエラーは表示されませんが、コンポーネントは表示されません。
私は私のセレクタ持つDefault.aspxページで:
<asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">
<app-main>Loading...</app-main>
</asp:Content>
boot.ts
import {bootstrap} from 'angular2/platform/browser'
import {AppComponent} from './app.component'
bootstrap(AppComponent)
app.component.ts
import {Welcome} from './app.module'
import {Component} from 'angular2/core'
@Component({
selector: 'app-main',
template: `<h1>${Welcome.GetWelcome()}</h1>`
}) export class AppComponent { }
app.module.ts
をexport class Welcome {
static GetWelcome(): string {
return "Hello World";
}
}
tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"watch": true,
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "ES5",
"module": "system",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"exclude": [
"./node_modules",
"./typings/main",
"./typings/main.d.ts"
]
}
コードがコンパイルされているが、ウェルカムメッセージは、APP-主にロードされていません。私はここで間違って何をしていますか?私は、Visual Studio 2015、バージョンと14.0
私は、angle2のビューでコントローラから文字列をバインドする方法ではないことは確かです。 :) – toskv