Change on ngModel reflecting on same ngModel of other browser angular2

梦想的初衷 提交于 2019-11-28 06:53:14

问题




I am new to angular 2 and creating a project on it. I am using npm to run angular 2 application. Currently, I am hosting application on localhost with 3000 port.

Problem in my project is that when I am visiting same page simultaneously on two different browser say crome and firefox. When I am typing on input on one browser, The other browser also reflecting same text on that input. Even input type password also reflecting same.

I checked in console and it is showing nothing and searched on web but not found any thing near to this problem. Please help me to know:

why different browser reflecting same text on same ngModel and how to fix it?


Below I pasted gif image to show how things are going wrong.


回答1:


I assume you use Browsersync. lite-server also uses this extention internally. It is a functionality from Browsersync.

So to avoid this behavior you can open http://localhost:3001 and switch off synchronization option for inputs:



来源:https://stackoverflow.com/questions/41331764/change-on-ngmodel-reflecting-on-same-ngmodel-of-other-browser-angular2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!