siriwave icon indicating copy to clipboard operation
siriwave copied to clipboard

Integrated in angular/typescript

Open tungUAS opened this issue 2 years ago • 2 comments

hey sir, thank you for the beatiful animation. I would like to add it to my chatbot written in Angular. I added this code to ngOnInit(): this.siriWave = new SiriWave({ container: document.querySelector("#myWave"), cover: true, height: 100, style: "ios9" });

But somehow i am getting the error: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. Can you please help me out ?

tungUAS avatar Jan 21 '22 18:01 tungUAS

Hello! Does the element document.querySelector("#myWave") exists in the DOM?

kopiro avatar Feb 07 '22 10:02 kopiro

@tungUAS verify you did not place container inside an *ngIf block and replace it with a [hidden] in that cause. I was having the same issue and that solved it for me. Give it a try.

Nuajan avatar Mar 10 '22 11:03 Nuajan