gpt4 book ai didi

angular - 如何在 Angular 8 中使用 EventEmitter

转载 作者:行者123 更新时间:2023-12-02 10:04:17 25 4
gpt4 key购买 nike

每当我创建 EventEmitter 时,它都会抛出错误

Expected 0 type arguments, but got 1.

statusUpdated = new EventEmitter<string>();

尝试过这个:

statusUpdated = new EventEmitter<>;
statusUpdated = new EventEmitter<>();
statusUpdated = new EventEmitter<{}>();

enter image description here

enter image description here

最佳答案

您必须从核心导入它

import {EventEmitter } from '@angular/core'

关于angular - 如何在 Angular 8 中使用 EventEmitter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57200864/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com