Зачем добавлять текст измененное событие требуется и как мы можем добавить в приложение Aurelia - PullRequest
0 голосов
/ 24 сентября 2019

таким образом мы можем добавить текст измененное событие?поделитесь полезной ссылкой, где я могу изучить приложение Aurelia

textbox.ts

export class Textbox {

  @bindable textValue='';
  @bindable displayName: string;

  constructor(controllerFactory) {
    this.controller = controllerFactory.createForCurrentScope();
    this.controller.validateTrigger = validateTrigger.changeOrBlur;
    this.controller.addRenderer(new BootstrapFormRenderer());    
  }

  attached() : void {
    this.controller.validate(); 
  }
}

ValidationRules
.ensure((c:Textbox) => c.textValue)
.required().withMessage("This field is required!")
.maxLength(50)
.on(Textbox);

textbox.html

   <input type="text" placeholder.bind="placeholder" onchange="alert('textvalue changed')"  class="form-control" value.bind="textValue & validate">

app.html

<template>
<textbox></textbox>
</template>
...