本文介绍了angular2绑定仅在鼠标移动后适用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是angular2的新开发人员,目前正面临我的应用程序的渲染问题.我将@ angular @ 2.0.0-rc.1用于我的应用程序,并将[email protected]用于我的路由,每当我单击链接时,页面的静态内容就会立即加载并进行绑定(动态内容)仅在我使用鼠标进行一些交互(例如单击或将鼠标悬停在链接上)时才会发生.我尝试了各种选择,但仍然无法弄清楚.

I'm a new angular2 development and currently facing a rendering issue with my application. I use @[email protected] for my app and [email protected] for my routing, whenever I click on the a link, the static content of the page loads immediately and the binding (dynamic content) happens only when I do some interaction with the mouse like click or hover over a link. I tried various options and still couldn't figure it out.

任何帮助将不胜感激.

推荐答案

包含JS文件的顺序很重要.我没去的时候就发生了这个问题.

The order in which you include the JS files is important.This issue happened when I didn't.

<script src="/lib/shim.min.js"></script>
<script src="/lib/system.js"></script>
<script src="/lib/system-polyfills.js"></script>
<script src="/lib/Reflect.js"></script>
<script src="/lib/zone.js"></script>

这篇关于angular2绑定仅在鼠标移动后适用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 03:58