66 * found in the LICENSE file at https://angular.dev/license
77 */
88
9- import { inject , Inject , Injectable , InjectionToken , Optional , SkipSelf } from '@angular/core' ;
9+ import { inject , Injectable , InjectionToken } from '@angular/core' ;
1010import { _IdGenerator } from '../a11y' ;
1111import { Observable , Subject } from 'rxjs' ;
1212import { debounceTime , distinctUntilChanged , startWith } from 'rxjs/operators' ;
@@ -30,17 +30,16 @@ export const MENU_STACK = new InjectionToken<MenuStack>('cdk-menu-stack');
3030/** Provider that provides the parent menu stack, or a new menu stack if there is no parent one. */
3131export const PARENT_OR_NEW_MENU_STACK_PROVIDER = {
3232 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 ( ) ,
3534} ;
3635
3736/** Provider that provides the parent menu stack, or a new inline menu stack if there is no parent one. */
3837export const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER = (
3938 orientation : 'vertical' | 'horizontal' ,
4039) => ( {
4140 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 ) ,
4443} ) ;
4544
4645/** Options that can be provided to the close or closeAll methods. */
0 commit comments