Good afternoon, everyone.
I have something to ask.
I want to know why ‘this.slug’ in the constructor is ‘undefined’ while {{ slug }} in the template has right value when it is called(used) in parent component’s template.
Is there anything I am missing on the understanding of component life cycle?
@Component({
selector: 'abcd',
template: `
<h2>Post List</h2>
{{ slug }}
`
})
export class PostListComponent {
@Input() slug: string;
constructor() {
console.log('PostListComponent::constructor()', this.slug);
}