以下Angular
应用程序正常运行,但我需要达到一些不依赖于我的要求:
GitHub回购:git@github.com:napolev/napolev.pr02.git
[1]
需要移动:main.ts
从/src/
移动到:/src/app/
[2]
需要删除文件:tsconfig.app.json
。
可能这个文件在文件中被部分引用:.angular-cli.json
(使用ext:.spec.json
代替:.app.json
,为什么?)
我试图删除它,但后来我遇到了构建错误:
> ng build
ENOENT: no such file or directory, stat 'D:\wamp64\www\ionic2\cli-angular-counter\src\tsconfig.app.json'
Error: ENOENT: no such file or directory, stat 'D:\wamp64\www\ionic2\cli-angular-counter\src\tsconfig.app.json'
at Error (native)
at Object.fs.statSync (fs.js:987:18)
at AotPlugin._setupOptions (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@ngtools\webpack\src\plugin.js:58:16)
at new AotPlugin (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@ngtools\webpack\src\plugin.js:26:14)
at _createAotPlugin (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@angular\cli\models\webpack-configs\typescript.js:55:12)
at Object.exports.getNonAotConfig (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@angular\cli\models\webpack-configs\typescript.js:70:19)
at NgCliWebpackConfig.buildConfig (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@angular\cli\models\webpack-config.js:27:37)
at Class.run (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@angular\cli\tasks\build.js:26:92)
at Class.run (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@angular\cli\commands\build.js:143:26)
at Class.<anonymous> (D:\wamp64\www\ionic2\cli-angular-counter\node_modules\@angular\cli\ember-cli\lib\models\command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
一个问题:
[3]
对于渲染的html文件,在哪里指定包含以下文件?
这是呈现的代码:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Angular Counter</title>
</head>
<body>
<app-root>Loading...</app-root>
<script type="text/javascript" src="inline.bundle.js"></script>
<script type="text/javascript" src="polyfills.bundle.js"></script>
<script type="text/javascript" src="vendor.bundle.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>
</body>
</html>
如果可能,请在答案中使用上面的参考号(方括号内)。如果可能,您可以提供修改后的代码吗?我尝试将此代码放在:plnkr.co/edit/
上,但没有成功。
[编辑]
我通过执行以下更改解决了点[1]
和[2]
:
http://github.com/napolev/napolev.pr02/commit/068d0884e360a2ec438032f209601b6b26ec5398
从[提交1]到[提交2] [2],但现在lint
测试工具无法正常工作,因为它没有检测到违反{{ 1}}声明的规则。例如,
在那里你可以看到一个带有制表符的行(根据我在tslint.json
文件中声明的规则是非法的)。在之前的提交中,它将被检测到。
如何让tslint.json
工具再次运作?