6
6
* found in the LICENSE file at https://angular.dev/license
7
7
*/
8
8
9
- import { inject , Inject , Injectable , InjectionToken , Optional , SkipSelf } from '@angular/core' ;
9
+ import { inject , Injectable , InjectionToken } from '@angular/core' ;
10
10
import { _IdGenerator } from '../a11y' ;
11
11
import { Observable , Subject } from 'rxjs' ;
12
12
import { debounceTime , distinctUntilChanged , startWith } from 'rxjs/operators' ;
@@ -30,17 +30,16 @@ export const MENU_STACK = new InjectionToken<MenuStack>('cdk-menu-stack');
30
30
/** Provider that provides the parent menu stack, or a new menu stack if there is no parent one. */
31
31
export const PARENT_OR_NEW_MENU_STACK_PROVIDER = {
32
32
provide : MENU_STACK ,
33
- deps : [ [ new Optional ( ) , new SkipSelf ( ) , new Inject ( MENU_STACK ) ] ] ,
34
- useFactory : ( parentMenuStack ?: MenuStack ) => parentMenuStack || new MenuStack ( ) ,
33
+ useFactory : ( ) => inject ( MENU_STACK , { optional : true , skipSelf : true } ) || new MenuStack ( ) ,
35
34
} ;
36
35
37
36
/** Provider that provides the parent menu stack, or a new inline menu stack if there is no parent one. */
38
37
export const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER = (
39
38
orientation : 'vertical' | 'horizontal' ,
40
39
) => ( {
41
40
provide : MENU_STACK ,
42
- deps : [ [ new Optional ( ) , new SkipSelf ( ) , new Inject ( MENU_STACK ) ] ] ,
43
- useFactory : ( parentMenuStack ?: MenuStack ) => parentMenuStack || MenuStack . inline ( orientation ) ,
41
+ useFactory : ( ) =>
42
+ inject ( MENU_STACK , { optional : true , skipSelf : true } ) || MenuStack . inline ( orientation ) ,
44
43
} ) ;
45
44
46
45
/** Options that can be provided to the close or closeAll methods. */
0 commit comments