learnstorybook-code
learnstorybook-code copied to clipboard
Missing diff on pure-task-list.component
While going through the Angular documentation I ran into an issue where I was getting a compilation error saying
Error: src/app/components/task-list/task-list.component.html:1:105 - error TS2345: Argument of type 'Event' is not assignable to parameter of type 'string'.
While going through and determining what went wrong, I compared against the commit referenced (https://github.com/chromaui/learnstorybook-code/commit/eb8da4c#diff-72eb450fab0a83eb8601422853c51299c37422e60f976305fcbae9776d44e2e6) and saw that there was a change that wasn't listed in the pure-task-list.component.ts
diff on the tutorial page https://storybook.js.org/tutorials/intro-to-storybook/angular/en/data/.
Essentially, on the tutorial page the only instruction was to rename task-list
to pure-task-list
. But in addition to that you need to remove the typecasting of <Event>
on the onPinTask
and onArchiveTask
outputs. When you look at the previous step, you define those outputs like this:
@Output()
onPinTask = new EventEmitter<Event>();
But what is required on the next step is this
@Output()
onPinTask = new EventEmitter();
And while I'm at it, it actually looks like the issue comes at the end of the previous step (https://storybook.js.org/tutorials/intro-to-storybook/angular/en/composite-component/) where that type casting is removed but not mentioned. Likely just needs to have that diff shown there.