0

I have implemented code of angular calendar in my project mentioned in link - https://mattlewis92.github.io/angular-calendar/#/kitchen-sink.

The code is running fine in Stackblitz but when I copied the same code in my project, I am getting following error at this line:

@ViewChild('modalContent', { static: true }) modalContent: TemplateRef;

Error message is as follow-

Argument of type '{ static: boolean; }' is not assignable to parameter of type '{ read?: any; }'. Object literal may only specify known properties, and 'static' does not exist in type '{ read?: any; }'

Can anyone please suggest how to solve this error.

2 Answers 2

1

Remove { static: true } if you are running angular version < 8

It would be just:

  @ViewChild('modalContent') modalContent: TemplateRef;
Sign up to request clarification or add additional context in comments.

Comments

0

The static option was only added in Angular 8. The error means that Stackblitz is using the most recent version of Angular while in your project you use Angular <= 7.

Either update your Angular version or remove the static field.

Comments

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.