Мне нужно знать, который выполняется первым в компоненте и порядке выполнения.
Get вызывается до того, как конструктор или Constructor будут вызваны первыми.Я не могу установить консоль в Get accessor.
export class AppComponent implements OnChanges {
title = 'app';
constructor() {
console.log('constructor called on App Component');
}
ngOnChanges() {
console.log(' onChanges called on App Component');
}
clicked() {
console.log('red');
}
get name(): string {
return 'sahir';
console.log('called get method');
}
}