Angular 5.x two-way binding doesn't work on Firefox for Windows or OSX
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When using the latest version of Firefox (58 at the time of issue submission) on either Windows or OSX, I can’t get the model of my component to change on text input. I start with a clean project generated by the CLI, which I have the newest version of. I add an input to the generated app component, after including the FormsModule in my app.module.ts file, like so:
<input [(ngModel)]="title" placeholder="app name">
After starting the app with ng serve
, I attempt to change the title of the app via the text box I created above. In Firefox on either Windows 10 or OSX Sierra (10.12.6), the title at the top of the page does not change in response to my input. But, if I switch to Chrome, the app works as expected, with the title matching the contents of that text input. I understand that, under the hood, this is no longer implemented as actual two-way data binding in Angular 2+. But it is my understanding that by using both []
and ()
around ngModel, I am declaring, in Angular 2+ language, what behaves/looks the same as two-way binding would have in AngularJS.
Expected behavior
I expect that the framework would support all major browsers on all major OSes.
Minimal reproduction of the problem with instructions
Steps to reproduce:
- Open the plunk provided below in Firefox 58 on a machine running either Windows 10 or OSX.
- Run the plunk and try to change the text in the input.
- It should be observed that the input changes, but the title does not.
Minimal Demo: http://plnkr.co/edit/YdAFv08aNZzqpbiSuI6e
What is the motivation / use case for changing the behavior?
I would like the browser I use to be supported by the framework so I don’t have to have two browsers open while trying to learn to use said framework. I would also expect that some of the users of my apps would also being using Firefox, and I would like my apps to work for them, as well.
Environment
Angular version: X.Y.Z
Angular version: 5.2.0
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version 58
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: 8.9.4
- Platform: Windows 10, Mac
Others:
Interestingly, Linux machines running Firefox do not seem to have this problem. I posted in the Angular gitter channel and other users reported that my code worked for them and that they were running Linux machines. These comments can be found here: https://gitter.im/angular/angular?at=5a6cfdedae53c159034279c5
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
@kyle-hall thanks for reporting your findings. I finally found the answer to why my code never seemed to work all those months ago when I first started Angular xD
Different issue but same feeling https://github.com/angular/angular/issues/19712 Why only me can see this?
BTW, I cannot reproduce your issue too. Good luck bro.