template-angular
template-angular copied to clipboard
upgrade to modern angular APIs
Hi, Thanks for the template. I have found it really useful and easy to understand for angular developers willing to step into Phaser.
I have a few suggestions to make (split into two commits):
upgrade to latest + ~~eslint~~
- I have upgraded to the latest available angular version (17.3.4)
- ~~I have added angular eslint schematic with the default configuration~~
- I have also added a consistent type imports ~~and a couple of more rules~~
refactor to new angular APIs.
- I have used signals to keep the state within the template (moveSprinte, spritePosition, etc)
- Remove unused imports on some components
- Added some type guards avoiding the use of " as "
- remove @ViewChild in favor of viewChild.required
I hope it proves helpful. Nevertheless, I'm open to discussion or further suggestions.
Thanks for this PR. Can I please check - the eslint configuration: Is this something you just personally find useful, or does this version of Angular actually require it? I'm asking because we generally avoid adding opinionated lint rules in our templates, because they're meant to be used the way you want to. However, if this is something Angular itself requires, that's different.
I added ESLint using @angular-eslint/schematics. It's not required at all by angular (allthougth recommended).
But I see your point, and makes perfect sense. I will update the PR removing the ESLint later today.