In angular there is a method called ngOnChanges
. i am trying to understand that,I tried with this code. but i am not getting any output.
any one help me to understand?
here is my code :
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { StorageService } from '../shared/service/storage.service';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss']
})
export class FooterComponent implements OnInit {
link = {};
constructor(private storage:StorageService) {
setTimeout(()=> {
this.link = "ariffff";
}, 1000 );
// console.log( this.storage.name);
}
ngOnInit() {}
ngOnChanges(changes) {
console.log(this.link, changes); //getting nothing
}
}