Commit graph

12 commits

Author SHA1 Message Date
SkyZeroZx
ca3ef38143 refactor(common): Removes unused imports to clean up dependencies
Eliminates unnecessary imports to reduce clutter and improve maintainability
2025-11-06 08:35:28 -08:00
iteriani
35032a6f6a refactor(core): Make it so that injecting with just a token guarantees an instance of the type provided. (#62338)
This allows us to pass in the following

const x = inject(FooService);

and have x be required.

PR Close #62338
2025-06-30 12:06:02 +00:00
iteriani
f849803f79 refactor(core): Add return value for defineInjectable. (#62303)
This allows the return value of this function to be passed into registerInjectable.

PR Close #62303
2025-06-27 10:34:14 +00:00
iteriani
ec01599987 refactor(core): Add Constructor type to injection types (#62265)
This allows us to pass in constructors into the inject function

PR Close #62265
2025-06-26 15:55:23 +00:00
iteriani
ba755830be refactor(core): Add injection primitives for shared services. (#62087)
This way, an arbitrary service can implement Angular's service requirements without a hard dependency on @angular/core

ex:

class Foo {
   bar = inject(Bar);
}

registerInjectable(Foo);

PR Close #62087
2025-06-25 14:57:57 +00:00
iteriani
4a107ed7af refactor(core): Return NOT_FOUND for retrieve instead of null (#60358)
This fits within the spec of the retrieve.

PR Close #60358
2025-03-27 19:39:59 +00:00
iteriani
69b688c7d1 refactor(core): Add an additional check for the name field for NotFoundError (#60322)
Inside g3, instanceof checks will fail. Instead, check the name field.

PR Close #60322
2025-03-18 15:05:52 +01:00
Rahat Ahmed
28459060a2 refactor(core): Support and document manually provided internal injections (#60347)
For internal framework values stored in injectors, they are manually
managed and inserted into injectors as needed. Therefore their tokens
don't provide a value or factory. This updates the type to reflect that
and updates the jsdocs a bit.

PR Close #60347
2025-03-14 13:40:40 +01:00
iteriani
92bb8d974b refactor(core): Use the retrieve method in the implementation of injectInjectorOnly (#60192)
This should keep the existing behavior intact. Right now retrieve never returns back NOT_FOUND. This should not be the case, but tests fail if I do add this behavior so itll have to be later.

PR Close #60192
2025-03-10 11:38:13 -07:00
iteriani
ac94604ef2 refactor(core): Remove the optional flag from Injector and all casts. (#60154)
Note that this does NOT use the retrieve method yet. I believe we need to move the logic for notFoundValue into the inject implementation.

PR Close #60154
2025-03-05 13:43:59 -08:00
iteriani
78b27a83fb refactor(core): Move getCurrentInjector/setCurrentInjector to primitives package. (#60090)
This change casts the injector back and forth since all instances of
injector currently don't implement the `retrieve` method. Note that
the retrieve method is seen as optional, so that Angular can revert back to
inject if necessary.

PR Close #60090
2025-02-28 18:47:08 +00:00
iteriani
8b757bf35c refactor(core): Check in some interfaces for the DI package (#59921)
This will be the starting point of the DI package. We will first check in some interfaces and then make sure the existing DI package implements that interface. Afterwards, we'll slowly start moving injector implementation.

PR Close #59921
2025-02-13 20:19:29 +00:00