1

Here are my compiler options:

"angularCompilerOptions": {
    "enableIvy": true,
    "strictTemplates": true,
    "strictInputTypes": true,
    "strictOutputEventTypes": true,
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }

The output looks like:

//I made sure to check EventEmitter was imported from '@angular/core'
@Output()
filterSubmitted = new EventEmitter<DashboardViewModel>();

When I hover in VS Code I see enter image description here Although I realize this is the VS Code service rather than the compiler. However, when I build make sure that the EventEmitter submits a different type than the function "filterSubmitted" accepts, I also do not get any compiler warnings/errors.

How can I fix this?

I'm using Typescript 4.1.5 and "@angular/compiler-cli": "^11.0.0", "@angular/compiler": "^11.0.0"

Edit: My question is not answered by How to use Custom Event (not Event Emitter) without `strictTemplates` to complain about `$event` not being a Custom Event type? because unless I'm missing something that answer is recommending casting the event to "any." My event seems to already be types as "any" and I want it to be typed correctly as the generic type of the "EventEmitter<>"

Mason
  • 737
  • 2
  • 9
  • 23
  • Does this answer your question? [How to use Custom Event (not Event Emitter) without \`strictTemplates\` to complain about \`$event\` not being a Custom Event type?](https://stackoverflow.com/questions/68490848/how-to-use-custom-event-not-event-emitter-without-stricttemplates-to-complai) – R. Richards Feb 14 '22 at 21:49
  • No, I dont think so, unless I'm missing something that answer is recommending casting the event to "any." My event seems to already be types as "any" and I want it to be typed correctly as the generic type of the "EventEmitter<>" – Mason Feb 14 '22 at 22:00

1 Answers1

0

Did you type the eventEmitter inside the sp-data-dashboard component?

@Output() filterSubmitted = new EventEmitter<boolean>();
S.Honderdos
  • 55
  • 10