While I know there are similar questions out there, none of them have provided the answer I'm looking for. My goal is to create a straightforward function in my Angular application.
In my app.component.ts file:
formClick() {
const formContainer = <HTMLElement>document.querySelector('.form-container');
const spinner = <HTMLElement>document.querySelector('.loading-spinner');
const form = <HTMLElement>document.querySelector('.email-form');
form.style.display = 'none';
spinner.style.display = 'block';
setTimeout(function(){
spinner.style.display = 'none';
formContainer.innerHTML('<h1>Thanks! We will get back to you shortly</h1>')
}, 1000);
}
However, I am encountering an error on my formContainer.innerHTML
line that states:
[ts] Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
(property) Element.innerHtml: string
I'm not quite sure what this error means. Any assistance would be greatly appreciated.
Thank you