我想一个模式添加到我的项目,所以我发现这个库:ng2-bootstrap类的ModalDirective“正确实现了接口“AfterViewInit”
我安装了它首先使用命令:npm install ng2-bootstrap --save
我类的样子:
import { Directive, ElementRef, Input, Renderer, AfterViewInit, OnDestroy } from
@angular/core';
import { ModalModule } from 'ng2-bootstrap/ng2-bootstrap';
@Directive({
selector: '[bsModal]',
exportAs: 'bs-modal'
})
export class ModalDirective implements AfterViewInit, OnDestroy {
@Input()
public set config(conf:ModalOptions) {
this._config = this.getConfig(conf);
};
@Output() public onShow:EventEmitter<ModalDirective> = new EventEmitter();
@Output() public onShown:EventEmitter<ModalDirective> = new EventEmitter();
@Output() public onHide:EventEmitter<ModalDirective> = new EventEmitter();
@Output() public onHidden:EventEmitter<ModalDirective> = new EventEmitter();
}
但我得到这个错误:
class 'ModalDirective' incorrectly implements interface 'AfterViewInit'