【发布时间】:2018-01-11 19:03:04
【问题描述】:
尝试使用 ASP.NET Core 设置我的第一个 Aurelia Hello World 项目。无法克服上述错误。
3 个文件,index.html、app.html、app.js:
索引.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body aurelia-app>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import("aurelia-bootstrapper");
</script>
</body>
</html>
app.html:
<template>
<div>${message}</div>
</template>
app.js:
export class App {
constructor() {
this.message = "Hello from Aurelia";
}
}
ASP.NET Core StartUp.cs:
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseDefaultFiles();
app.UseStaticFiles();
app.Run(async (context) =>
{
//await context.Response.WriteAsync("Hello World!");
});
}
}
}
否则一切都是标准的。运行以下命令来安装 Aurelia:
jspm install aurelia-framework
jspm install aurelia-bootstrapper
非常基本但出现错误: Error:
【问题讨论】:
-
你看到他们的skeleton projects了吗?可能有助于开始。
标签: javascript asp.net-core aurelia