0

I'm sorry if the title isn't easily understandable at one glance. But I'm having very weird behaviour in my visual studio code. I'm seeing errors for very weird things like:

[ts] Cannot find name 'constructor'

and many more. The errors started after I edited the code on another computer and pushed to git. On my main computer, I pulled from my git repo. The files came with many weird characters which i had to remove manually. All other files are working fine, but this specific file, verify.component.ts is showing weird behaviour. Someone help me please!! Thank you

The reposiory

The image

3 Answers 3

1

You do not need }

export class VerifyComponent implements AfterViewInit {
  @ViewChild('username')  username: MatInput;
} // remove this }
Sign up to request clarification or add additional context in comments.

1 Comment

OMG I can't believe I did something so foolish. Thank you @Sajeetharan
1

Incorrect syntax, please remove the curly braces and try.

enter image description here

Comments

0

as Sajeetharan said, and Also you are not implementing the AfterViewInit

ngAfterViewInit() {

  }

3 Comments

implementing ngAfterViewInit is not necessary.
I'm new to this so maybe it's a stupid question but if you're saying implements AfterViewInit, don't you need to implement it?
@CaseyR , I believe that he meant that the implementation is not causing the compilation error mentioned above, that’s true. However it’s a good practice to implement the interface if you are using it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.