-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(@schematics/angular): add generator for interceptor #15260
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Thanks for the PR! We think both the frequency of adding an interceptor and the complexity of the adding one are pretty low. So we are leaning towards not needing this schematic for now. |
If you say so. Thanks for the feedback though. |
While in the end of any project, the maintainers are the final deciding voice and that within itself is something I respect greatly, it seems to me (from a user looking at the project) that many of the schematics are simply convinience tools. EG, the component generator. The component complexity seems relatively low, especially once you have an initial component to copy+paste off of. However, for an interceptor I don't often use them for various projects and then have to Google the correct usage of it (or find which of my many Angular projects has one to copy off of), so having this generator (even if the complexity is low overall) is a big convinience for me as I end up using it enough to come looking for this issue every now and then The engagement with the linked issue (which has unfortunately fallen victim to the "+1" comment wave, but even with reacts alone) seems to show a further community interest Just giving my own thoughts, huge thank you to everyone on the Angular team for your persistent hard-work on the project regardless of where this issue lands |
Hi @FG-33 - We discussed this again and decided to accept this PR! We had some comments on the PR(forthcoming) and we can merge this as soon as they are addressed. Thanks! |
...interceptor/files/__name@dasherize@if-flat__/__name@dasherize__.interceptor.spec.ts.template
Outdated
Show resolved
Hide resolved
...ular/interceptor/files/__name@dasherize@if-flat__/__name@dasherize__.interceptor.ts.template
Outdated
Show resolved
Hide resolved
Also, to answer your question, master is the correct branch. |
Can you also add
|
@clydin I addressed all the mentioned changes. If anything's missing, let me know. |
I am glad this got merged in. Echoing @crutchcorn's appreciation for the Angular team as well as his reasoning for having a generator, we have several teams in my organization that are starting to develop with Angular 8 now and having a generator in place not only for the meat and potatoes of Angular but also these arguably more tangential use cases is helpful as I can simply mention the generator syntax in our guidelines and documentation and take more comfort in code being generated uniformly across teams. This increased conformance then cuts out nuisance PR comments that may be the result of copy/paste code propagation. Long story short, thank you! It is appreciated. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
It is now possible to generate interceptors using the angular-cli (see #6937):
$ ng g interceptor(ic) test
Result:
Is master the correct one to merge into? The documentation says devkit:master but there's no such branch. devkit is too far behind I guess.