Helo All,
I am facing a issue, as I am new in Angular so it may be a something I am missing.
In my application, in one of the child component ngOnChanges is getting called irrespective on any change, In below screen shot you will find all the currentValues and previousvalues properties of changes object is same.
Let me know if I am missing something.
Please also refer below code
Thanks
import { Component, Input, SimpleChanges, OnInit} from '@angular/core'; import { OnChanges, OnDestroy } from @angular/core/src/metadata/lifecycle_hooks';
@Component({
selector: 'xxxxxx',
templateUrl: './result.component.html',
styleUrls: ['./result.component.css']
})
export class ResultComponent implements OnInit, OnChanges, OnDestroy {
@Input()
searchResults: SearchResults.SearchResult;
@Input()
searchText: string;
@Input()
loading: boolean = false;
ngOnInit() {
var logger = "stop me debugger";
}
ngOnChanges(changes: SimpleChanges) {
if (changes.searchResults && !changes.searchResults.firstChange) {
}
}
ngOnDestroy(): void {
var logger = "stop me debugger";
}
constructor() {
}
}
