使用.NET配置Angular2

时间:2017-02-09 12:44:20

标签: .net angular

大家好我正在尝试使用.NET webProject配置角度2应用程序,但我遇到一些问题,我不知道如何修复或知道它们出现的原因。

错误的快照。所有都发生在类型def文件中 enter image description here 我正在使用webpack

var webpack = require('webpack');

module.exports = {
    entry: './App_UI/entry/main.ts', 
    output: {
        path: './App_UI/bundle',
        filename: 'app.bundle.js'
    },
    module: {
        loaders: [
            { test: /\.ts$/, loader: 'ts-loader' }
        ]
    },
    resolve: {
        extensions: ['.js', '.ts']
    }
};

package.json看起来像这样

"name": "search-engine",
  "version": "0.1.0",
  "license": "ISC",
  "scripts": {
    "lite": "lite-server",
    "postinstall": "typings install",
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "dependencies": {
    "@angular/common": "~2.4.5",
    "@angular/compiler": "~2.4.5",
    "@angular/compiler-cli": "~2.4.5",
    "@angular/core": "~2.4.5",
    "@angular/http": "~2.4.5",
    "@angular/platform-browser": "~2.4.5",
    "@angular/platform-browser-dynamic": "~2.4.5",
    "@angular/router": "~3.4.5",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.19",
    "bootstrap": "^3.3.7",
    "core-js": "~2.4.1",
    "ng2-bs3-modal": "^0.10.4",
    "reflect-metadata": "^0.1.8",
    "rxjs": "~5.0.1",
    "zone.js": "~0.7.6"
  },
  "devDependencies": {
    "@types/core-js": "^0.9.35",
    "lite-server": "^2.2.2",
    "ts-loader": "^2.0.0",
    "tslint": "^4.4.2",
    "typescript": "^2.1.5",
    "typings": "^2.1.0",
    "webpack": "^2.2.1"
  }

和tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false
  }
}

我缺少什么?

错误是在构建项目构建失败时:1 |成功1 一些错误,例如state:`找不到名字“schedulre”,“number”。等。 我想它不知道“承诺,可观察,行动”。

1 个答案:

答案 0 :(得分:0)

我决定使用angular-cli创建一个项目,只需复制我需要的项目,包括web项目中的文件,就是这样。