Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

angular - Change on ngModel reflecting on same ngModel of other browser angular2



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. enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...