[英]Working with dotnet and angular2
I have recently integrated a boostrap admin template (based on Angular2) in an asp project (here is the repo ) 我最近将一个boostrap admin模板(基于Angular2)集成到一个asp项目(这是repo )中
The thing is: when I am running tsc
, all files compile well, but if I change html
files, if the web browser (let say firefox) opened the project previously, the page never change, but if I open a new web browser (let say chrome) I can see the change. 关键是:当我运行
tsc
,所有文件都可以很好地编译,但是如果更改html
文件,则如果Web浏览器(比如说firefox)以前打开了该项目,则页面永远不会改变,但是如果我打开一个新的Web浏览器(假设是chrome)我可以看到更改。 Now, if I change an html
again, neither one can detect new changes in html
files. 现在,如果我再次更改
html
,则没人能检测到html
文件中的新更改。
I think it is dotnet
configuration, because I used the bootstrap angular template which is set up with npm lite server, and it has not any problems (I mean: change .ts
files, .html
files and it refresh always well) 我认为这是
dotnet
配置,因为我使用了由npm lite服务器设置的bootstrap角度模板,并且没有任何问题(我的意思是:更改.ts
文件, .html
文件,并且刷新总是很好)
To reproduce the problem, these are the steps: 要重现此问题,请执行以下步骤:
login.component.ts
: template: <h1> Hello!</h1>
login.component.ts
: template: <h1> Hello!</h1>
login.component.ts
: template: <h1> Hello World!</h1>
login.component.ts
: template: <h1> Hello World!</h1>
The asp
app were caching the pages, so I changed the web.config
asp
应用程序正在缓存页面,因此我更改了web.config
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="no-cache, no-store" />
<add name="Pragma" value="no-cache" />
<add name="Expires" value="-1" />
</customHeaders>
</httpProtocol>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.