Hello everyone,
I am currently facing an issue in my Angular application and I believe it might be due to my lack of experience with Angular.
Specifically, I have noticed that in one of the child components, ngOnChanges is being called even when there are no changes. Upon inspecting the changes object, I found that both currentValues and previousValues properties are the same.
If anyone has any insights or suggestions on what I might be missing, please let me know.
Please refer to the code snippet below as well:
Thank you!
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() {
}
}