I want to check for character validation where the input is a string, and I have to check for...

Discussão em 'Angular' iniciado por Kevin Joby, Abril 30, 2025.

  1. Kevin Joby

    Kevin Joby Guest

    The problem is the same as a typing challenge. The character entered should be checked with its already generated string. It's just the same as MonkeyType. This is to be done in angular.

    export class AppComponent {
    title = 'typingchallenge';
    randomText: string = 'Hello World';
    text: string = '';

    onInput(event:Event) {
    var value = (event.target as HTMLInputElement).value;
    console.log(value);
    }
    }


    I didn't know what to use for the logic, class based or template based?

    <p class="has-text-centered">
    {{randomText}}
    </p>

    <div class="field">
    <input class="input" (input)="onInput($event)" />
    </div>

    Continue reading...

Compartilhe esta Página