This pen demonstrates the JavaScript functionality to retrieve and set the start and end range selection values for "input" / "textarea" fields.
A Pen by K.C.Ashish Kumar on CodePen.
Usually while developing / testing an Angular application, there is a need to run a particular flow to reach a specific screen and then if we want to make any code changes like CSS / TS / TEMPLATE, then again we need to go back and come from the beginning to that specific screen. This might be easier if the screen appears 2nd or 3rd in the flow, but if the screen appears at 10th position for example, then it gets difficult to complete the flow and test with all the possible combinations each time.
To address this complexity, there is an easier way to simulate the various combinations, as described below.
In the constructor of your Angular component, inject the ngZone
property.
import { NgZone } from '@angular/core';
/** | |
* @dynamic is for runtime initializing DomHandler.browser | |
* | |
* If delete below comment, we can see this error message: | |
* Metadata collected contains an error that will be reported at runtime: | |
* Only initialized variables and constants can be referenced | |
* because the value of this variable is needed by the template compiler. | |
*/ | |
// @dynamic | |
export class DomHandler { |