Closed psarno closed 1 year ago
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
If we change a component to a self-closing tag after another error has occured during compilation, it refuses to pick up the changes to the self-closing tag.
I don't know what area this is in, I chose "compiler" because that seemed the closest.
Example:
You call the wrong method in a component:
<some-component (onClick)="doThis($event)"></some-component>
You have not declared
doThis(event)
, and save the HTML.The compilation runs, and fails, due to the method not being implemented.
You realize this was supposed to call "doSomething", and then return to the component to make your changes. At the same time, you realize it can use Angular 16's new self-closing tags:
<some-component (onClick)="doSomething($event)" />
You save this. The compiler will still error out, stating now that:
Nowhere in the code does it now reference the "doThis" mistake. Everything is saved.
But it won't compile anymore. It requires stopping the "
ng serve
" and re-running it. Then it works fine.Please provide the exception or error you saw
Note "
doThis
" does not exist in the HTML anymore. The file has been saved. When the compiler runs again, it complains about this. The HTML now containsdoSomething()
, the correct call. It is seeing the older version.Please provide the environment you discovered this bug in (run
ng version
)Anything else?
Nope.