There is a problem that is posing itself as a show-stopper or deal-breaker. We've completed a web app, using angular 5 & template driven forms where everything works but this one feature is just killing us. It's like a sniper shot.
From time to time, on our laptops and desktops, we experience slow typing into the text fields of our application's input fields. And this happens across the board, ( that is windows, mac, safari, chrome ).
The situation lasts for a while and then it totally goes away! During the happening, there is no indication of anything we can detect (other than the symptom itself ). I mean there are no console log errors, no high CPU activity, no nothing!.
The problem is that we simply observe some delay ( up to a second ) in the appearance of the letters we type in, into the textfields and textrea boxes.
How would you debug this situation?
So far, I have applies the following solutions; spellcheck=no, autocapitalize=off autocomplete=off autocorrect=off But this does not put an end to this saga.
I also compile the app using the "ng build --prod" so it is totally optimized.
Are there any other suggestions you can offer?
Here is how a sample textarea HTML is:
<textarea placeholder="enter text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" name="description" [(ngModel)]="learningPlan.description" maxlength="1500" #local_description="ngModel"></textarea>
Is it possible to tell angular to not to do the change detection on these input boxes while typing is going on? I'm running out of options.
There is one possible suggestion in this link whereby someone is suggesting to do this: @Output() event : EventEmitter<any> = new EventEmitter(false);
But it does not say where this line of code is supposed to go in.
For Angular versions,less than 8, viewChild is annoted with ElementRef type in component to read the input value. Finallly, read the input value using ElementRef.nativeElement.value. Controller typescript component on reading input element value on button click. This talks about how to read input text value in typescript.
Form contains multiple html input elements to take input from the user. button allows the user to submit the from to backend API an d it calls click binding event. In Angular, View is html template and controller is an typescript component. Reading input text is basic concept every Angular developer need to know.
Is your app slow? Learn what to watch out when debugging poor performance in your Angular apps! Angular is, by default, a fast and performant framework. While it leaves ample space for improvement by opting out some of its magic, we almost never have to do anything special to write extremely performant code for the average app.
Some of that data will be mandatory for all the routes, some not. But in any case, it’s useful to strongly type your routes, just like the rest of your codebase. In this article, I’ll quickly go through the base data types of the Angular router, then we’ll explore how to strongly type our Angular routes.
I've found this discussion ionic issue 10837 and i've solved with content on this link.
In my case, this problem was visible when i typed inside a modal. So, my code turned into this:
constructor(public changeDetection: ChangeDetectorRef) {}
openModal() {
this.changeDetection.detach();
//open modal
modal.callback ( r => {
this.changeDetection.reattach();
});
}
Try to use enableProdMode. You enable it by:
import {enableProdMode} from '@angular/core';
:
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With