-
Notifications
You must be signed in to change notification settings - Fork 168
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
Service decorator name #9
Comments
|
Awful? It might be not a great name but it's very descriptive - it marks the class as injectable so you can inject it in your other classes (by constructor od explicit Also it provide more consistency - you have And of course if someone like I is a fullstack and do both frontend in Angular 2 with Now I'm using You don't have to rename it, maybe exporting an alias and place info in doc is enough... but I know you don't like aliases 😉 |
I find
I understood that you want consistency however I don't think angular named it the best possible way - Plus I think having same decorator name just confuses users when they import - they may accidentally import injectable from typedi in frontend part (angular) and injectable from angular in backend code.
nope, anyone would.
I see zero point in it. Does it make sense for example if I use inversify and do:
better to say noone likes reduplication because its confusing |
Ok, I get you point of view but I'm also trying to show you the point of view of people like me half year ago. I saw the
Who mix frontend code with backend? I prefer separate repos for backend and frontend or sometimes separate folders on the same repo but never one fullstack TS project with one tsconfig... services would be then mixed in |
but what else it can be if not a service
many people and full-stack frameworks do. Meteor for example. There are lot of challenges in merged backend and frontend, but benefits as well. For example you can easily share your models which are in most of cases 100% equal on both sides representation. |
A factory for creating objects (like TypeORM
Yeah, but they are a monolith framework where everything is connected together. I said about developers which create backend with
Do you use single tsconfig and build chain for both part of the app? I always use different tsconfigs for backend and frontend - backend is compiled to ES6/7 (node.js) by tsc, frontend to ES5 with webpack with many polyfills. I don't have single package.json with all dependecies but one for frontend, one for backend. So in this case even VSCode quick-fix won't suggest you to import Angular's
Single project is really not needed - I've already did this with npm packages on 3 separate repos (frontend, backend, models) which are connected by dependecies in package.json ( Also when you have both backend and frontend really mixed together in one project folder it might be hard to create e.g. mobile version with |
this discussion won't lead to anything, simply because |
sorry, i wanna inject repository to my service and '@service' is not a good decorator name for my repository. what can i do except rename ? |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
From
@Service
JSdoc:So it works like in Angular Injector and Inversify, so maybe it would be better to rename it to
@Injectable
like in this two DI?@Service
could be deprecated and exported as an alias for@Injectable
for now.The text was updated successfully, but these errors were encountered: