【发布时间】:2017-02-16 09:48:13
【问题描述】:
Webpack 中的Index.html
<!doctype html>
<html>
<head>
<base href="/">
<title>ng2-webpack</title>
</head>
<body>
<my-app>Loading content here ...</my-app>
</body>
</html>
SystemsJS 中的Index.html
<!DOCTYPE html>
<html>
<head>
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
System.import('app').catch(function (err) { console.error(err); });
</script>
</head>
<body>
<my-app>Loading content here ...</my-app>
</body>
</html>
数据库检索代码
this.headers = new Headers();
this.headers.append('Content-Type', 'application/json; charset=utf-8');
let options = new RequestOptions({
method: RequestMethod.Post,
url: "data.aspx/getvalue",
headers: this.headers,
body:{log:this.login}
});
return this._http.request(new Request(options)).retry(2)
.map((response: Response)=>this.extractData(response))
.do(data => {this.temp=data, console.log('getStepList:'+ JSON.stringify(JSON.parse(this.temp.d)))})
.catch(this.handleError);
使用系统js
当使用npm run command all ts file converted into js 然后run index.html in visual studio 然后一切正常
将 systemjs 切换到 webpack
当我将systemjs to webpack 切换为开发Index.html not include any file 和ts file converted into js 仅在使用npm run build 构建应用程序时,所以每次我必须构建应用程序然后将该dist 文件夹放入Visual Studio 中以从数据库中获取数据。
I felt this process headache so can any one tell me how to use in `visual studio 2013`
【问题讨论】:
标签: angular visual-studio-2013 webpack systemjs webpack-dev-server