I can't register my component. If I set
<app-actions-button></app-actions-button>
This is work good. But if I set
<app-actions-button (send)="some($event)"></app-actions-button>
i got error:
ERROR in src/app/test.component.html:162:1 - error NG8001: 'app-actions-button' is not a known element:
Check my module:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ActionsButtonRoutingModule } from '../actions-button/actions-button-routing.module';
import { ActionsButtonComponent } from './actions-button.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ModalModule } from "ngx-bootstrap/modal";
@NgModule({
declarations: [ActionsButtonComponent],
imports: [
CommonModule,
ActionsButtonRoutingModule,
FormsModule, ReactiveFormsModule,
ActionsButtonComponent
],
exports: [ActionsButtonComponent],
})
export class ActionsButtonModule { }
Your component app-actions-button
dose not have an @Output
property and it fails to compile.
You can read more on how to implement it here in the @Output Angular docs
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.