1 year ago

#191626

test-img

Beshman88

Setting Component Property to Use After ngOnInit()

I am very new to angular. So trying to learn while working on an existing code base.

I'm trying to setup a div to display when a message is loaded in a component.

The div will show fine once the correct property is set.

However, I'm setting the component property before it hits the ngOnInit method

I'm setting this property publically as there are more than one places to set this message, I've even set it after the routing has been triggered, but the component hits the ngOnInit resetting the property.

Is there a way to set this property, without it being global, for a specific component.

I'm assuming there's a "wait" method I'm not aware of after googling this for ages.

angular

ngoninit

0 Answers

Your Answer

Accepted video resources