Angular 8: Grandparent Component detect when User Focus out of grandchild Component Textbox

社会主义新天地 提交于 2020-01-25 10:13:33

问题


I have a Nested Grantparent Smart Component, Parent Component with a Form, and a Grandchild Component with ZipCode textbox.

How do I make it so, when user clicks out of the grandchild Component Textbox, Grandparent Component will know? Need to run business logic after user clicks out of textbox. Currently textbox is based off Material Angular wrapper.

so

  1. Grand Smart Component
  2. Parent Form
  3. Textbox

Parent Component has Formbuilder and many textboxes, sample below

this.editAddressForm = this.formBuilder.group({
   'city': [null,[Validators.maxLength(50)]],
   'zipCode': [null,[Validators.maxLength(10)]],


<app-input-textbox class = "zipcodeclass" div="zipcode" formControlName = "zipCode">

来源:https://stackoverflow.com/questions/59779037/angular-8-grandparent-component-detect-when-user-focus-out-of-grandchild-compon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!