简体   繁体   English

如何将Aurelia入门教程与TypeScript一起使用?

[英]How to use Aurelia Getting Started tutorial with TypeScript?

Aurelia has a getting started guide which covers using TypeScript and VS2015. Aurelia 的入门指南涵盖了如何使用TypeScript和VS2015。 I've downloaded the TypeScript Kit, and opened it as a website in VS2015. 我已经下载了TypeScript工具包,并在VS2015中将其作为网站打开。 I can view index.html in a browser. 我可以在浏览器中查看index.html However, when I edit app.ts , I don't see my changes when I reload index.html . 但是,当我编辑app.ts ,重新加载index.html时看不到更改。 I use VS2015 Community Edition with update 2. TypeScript is installed. 我将VS2015 Community Edition与更新2配合使用。已安装TypeScript。

I'm missing something basic about how VS compiles TS into JS. 我缺少有关VS如何将TS编译成JS的基本知识。

Any ideas? 有任何想法吗?

[Edit] The JS console contains debug statements about several Aurelia plugins being loaded and configured. [编辑] JS控制台包含有关正在加载和配置的几个Aurelia插件的调试语句。 It then reports that Aurelia has started. 然后报告Aurelia已开始。 Lastly, it says that resources are imported for app.html . 最后,它说资源是为app.html导入的。 I see no errors in the console. 我在控制台中看不到任何错误。

As @qtuan suggested, the problem was that the page was being cached. 正如@qtuan所建议的那样,问题在于该页面已被缓存。 I initially thought this, and did Ctrl-F5 in Chrome on Windows to reload the page without using the cache. 我最初是这么认为的,并在Windows上的Chrome浏览器中使用Ctrl-F5来重新加载页面而不使用缓存。 For some reason, this did not behave as expected and I saw the original page. 由于某种原因,这没有达到预期的效果,我看到了原始页面。 When I ticked "Disable cache" in Chrome's Dev Toosl, under Network, then the page refreshed as expected. 当我在Chrome的Dev Toosl中的“网络”下勾选“禁用缓存”时,页面会按预期刷新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM