0
我採用了棱角分明4基本啓動,並與ngChanges工作,我得到這個錯誤類錯誤地實現了接口'OnChanges'。物業「ngOnChanges」中缺少類型
班「GalleryComponent」正確實現接口 「OnChanges'.Property‘ngOnChanges’在類型 'GalleryComponent'中缺失。
我真的不知道該怎麼辦,我知道,一個類可以有倍數接口,但使用的事件只是一個它顯示了同樣的錯誤
import { Component, OnInit, OnChanges, Input } from '@angular/core';
import { ImageService } from '../image/shared/image.service';
@Component({
selector: 'app-gallery',
templateUrl: './gallery.component.html',
styleUrls: ['./gallery.component.css']
})
export class GalleryComponent implements OnInit, OnChanges {
visibleImages: any[] = [];
constructor(private imageService: ImageService) {
this.visibleImages = this.imageService.getImages();
}
ngOnInit() {}
OnChanges(){}
}
我會,如果有人很感激可以看到什麼我缺少 由於事先
是不是函數定義:'ngOnChanges(變化:SimpleChanges)的''而不是onChanges()'? – puelo
woooo你是對的..那是錯誤,非常感謝你 –