feat(ivy): support injection even if no injector present (#23345)
- Remove default injection value from `inject` / `directiveInject` since it is not possible to set using annotations. - Module `Injector` is stored on `LView` instead of `LInjector` data structure because it can change only at `LView` level. (More efficient) - Add `ngInjectableDef` to `IterableDiffers` so that existing tests can pass as well as enable `IterableDiffers` to be injectable without `Injector` PR Close #23345
This commit is contained in:
@ -6,8 +6,10 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {InjectableDef, defineInjectable} from '../../di/defs';
|
||||
import {Optional, SkipSelf} from '../../di/metadata';
|
||||
import {StaticProvider} from '../../di/provider';
|
||||
import {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';
|
||||
|
||||
|
||||
/**
|
||||
@ -135,6 +137,11 @@ export interface IterableDifferFactory {
|
||||
*
|
||||
*/
|
||||
export class IterableDiffers {
|
||||
static ngInjectableDef: InjectableDef<IterableDiffers> = defineInjectable({
|
||||
providedIn: 'root',
|
||||
factory: () => new IterableDiffers([new DefaultIterableDifferFactory()])
|
||||
});
|
||||
|
||||
/**
|
||||
* @deprecated v4.0.0 - Should be private
|
||||
*/
|
||||
|
Reference in New Issue
Block a user