这是我的代码:
我有我的 app.module.ts
import { CustomAlertComponent } from './pages/common/custom-
alert.component';
@NgModule({
imports: [...],
exports: [ ..., CustomAlertComponent],
declarations: [.., CustomAlertComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)
自定义警报.component.html
<ngb-alert *ngIf="!staticAlertClosed" [type]="type" (close)="true">{{message}}</ngb-alert>
Run Code Online (Sandbox Code Playgroud)
自定义警报.component.ts
import { Component, OnInit, Input, EventEmitter } from '@angular/core';
@Component({
selector: 'custom-alert',
templateUrl: './custom-alert.component.html'
})
export class CustomAlertComponent implements OnInit {
@Input() message: string;
@Input() type: string;
@Input() staticAlertClosed:boolean;
constructor() {}
ngOnInit(){}
}
Run Code Online (Sandbox Code Playgroud)
和 start-workflow.component.ts
import { Component, OnInit, ViewEncapsulation, ViewContainerRef, Input, Output, EventEmitter } from …Run Code Online (Sandbox Code Playgroud)