相关疑难解决方法(0)

Angular 2:找不到NgModule元数据

我是Angular 2的新手,并试图跟随我发现的视频教程.尽管遵循了所有步骤,但Angular不会起作用; 我收到以下错误:

compiler.umd.js:13854 Uncaught Error: No NgModule metadata found for 'App'.
Run Code Online (Sandbox Code Playgroud)

并且该组件根本不加载.

这是我的文件:

的package.json:

{
  "name": "retain",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "webpack --config webpack.spec.ts --progress --color && karma start",
    "start": "webpack-dev-server --inline --colors --progress --display-error-details --display-cached --port 3000  --content-base src"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "core-js": "2.4.1",
    "lodash": "4.16.1",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.25"
  },
  "devDependencies": { …
Run Code Online (Sandbox Code Playgroud)

typescript webpack angular

54
推荐指数
7
解决办法
9万
查看次数

标签 统计

angular ×1

typescript ×1

webpack ×1