Animated SVG in Component

I didn’t have an idea how my header should be written :P.
I saw many times that site with lifecycle and now I’m trying to get an item from svg object in ngAfterViewInit() function. Getting whole svg runs properly. The problem is shadow DOM. If I want to get the item from that svg it takes some time. So after calling ngAfterViewInit() function there is no shadow DOM created and cannot get the item from it :frowning:.

It could be a cause how I loaded that svg.

So I have something like that (in ngAfterViewInit())

    let svgObj = document.getElementById("icon") as HTMLObjectElement;
    let svgDoc = svgObj.contentDocument;
    let lock = svgDoc.getElementById("lock");