Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...