angular中如何获取被引用组件内的方法

步骤:html 设置一个变量,将其用 ViewChild装饰, 将该变量的类型设定为被引用组件的类名(class 后面的那个单词),如注释B中所释代码 调用该变量,采用变量名+“." 的方式调用该变量内的方法,如注释C中所释代码。 import {Component, OnInit, ViewChild} from "@angular/core"; import {FormComponent} f
相关文章
相关标签/搜索