Aurelia quick start或我的第一款应用Hello World-未发现视图模型错误,2017年

Aurelia quick start或我的第一款应用Hello World-未发现视图模型错误,2017年,aurelia,Aurelia,在angular2和reactjs中做了一些小应用之后,这是我第一次尝试Aurelia。 我的第一个应用程序在快速启动后出现错误,只是更新应用程序以显示“hello world”: 我有一个错误: 未捕获(承诺中)错误:在模块“src/app”中找不到视图模型。 在aurelia core.min.js:7 知道发生了什么事吗?我不清楚这个错误;aurelia能很好地管理错误消息吗 “视图模型”是指html模板文件 /index.html <!DOCTYPE html> <h

在angular2和reactjs中做了一些小应用之后,这是我第一次尝试Aurelia。 我的第一个应用程序在快速启动后出现错误,只是更新应用程序以显示“hello world”:

我有一个错误:

未捕获(承诺中)错误:在模块“src/app”中找不到视图模型。 在aurelia core.min.js:7

知道发生了什么事吗?我不清楚这个错误;aurelia能很好地管理错误消息吗

“视图模型”是指html模板文件

/index.html

<!DOCTYPE html>
<html>
  <head>
    <title>Aurelia</title>
  </head>
  <body aurelia-app="src/main">
    <script src="scripts/system.js"></script>
    <script src="scripts/config-typescript.js"></script>
    <script src="scripts/aurelia-core.min.js"></script>
    <script>
      System.import('aurelia-bootstrapper');
    </script>
  </body>
</html>
<!DOCTYPE html>
<html>
  <head>
    <title>Aurelia</title>
  </head>
  <body aurelia-app="src/main">  <!-- Bootstrap here --> 
    <script src="scripts/system.js"></script>
    <script src="scripts/config-typescript.js"></script>
    <script src="scripts/aurelia-core.min.js"></script>
    <script>
      System.import('aurelia-bootstrapper');
    </script>
  </body>
</html>
更新:错误为app.ts为app.ts为空

/src/app.ts

export class App {
    heading = "Hello World";

}
export class App {
    heading = "Hello World";
}
/src/app.html

<template>
  <h1>${heading}</h1>
</template>

${heading}

错误是我的应用程序。ts为空,生成“未找到视图模型”

在index.html上,我们通过main.js或main.ts文件引导应用程序(如果我们使用的是typescript)

/src/index.html

<!DOCTYPE html>
<html>
  <head>
    <title>Aurelia</title>
  </head>
  <body aurelia-app="src/main">
    <script src="scripts/system.js"></script>
    <script src="scripts/config-typescript.js"></script>
    <script src="scripts/aurelia-core.min.js"></script>
    <script>
      System.import('aurelia-bootstrapper');
    </script>
  </body>
</html>
<!DOCTYPE html>
<html>
  <head>
    <title>Aurelia</title>
  </head>
  <body aurelia-app="src/main">  <!-- Bootstrap here --> 
    <script src="scripts/system.js"></script>
    <script src="scripts/config-typescript.js"></script>
    <script src="scripts/aurelia-core.min.js"></script>
    <script>
      System.import('aurelia-bootstrapper');
    </script>
  </body>
</html>

你能发布你的app.ts文件内容吗?视图模型是*.ts文件,视图是*.html文件。谢谢@Lakerfield,我的错误是我从快速入门网站粘贴app.ts内容后没有保存它,内容是空的。昨天工作到这么晚@杰夫格,我需要等两天