@angular/core#InjectionToken TypeScript Examples

The following examples show how to use @angular/core#InjectionToken. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: mermaid.token.ts    From visualization with MIT License 6 votes vote down vote up
MERMAID = new InjectionToken<Mermaid>(
  'Mermaid',
  {
    providedIn: 'root',
    factory(): Mermaid {
      return mermaid;
    }
  }
)
Example #2
Source File: animation-frame.ts    From common with MIT License 6 votes vote down vote up
ANIMATION_FRAME = new InjectionToken<Observable<DOMHighResTimeStamp>>(
    'Shared Observable based on `window.requestAnimationFrame`',
    {
        factory: () => {
            const {requestAnimationFrame, cancelAnimationFrame} = inject(WINDOW);
            const animationFrame$ = new Observable<DOMHighResTimeStamp>(subscriber => {
                let id = NaN;
                const callback = (timestamp: DOMHighResTimeStamp) => {
                    subscriber.next(timestamp);
                    id = requestAnimationFrame(callback);
                };

                id = requestAnimationFrame(callback);

                return () => {
                    cancelAnimationFrame(id);
                };
            });

            return animationFrame$.pipe(share());
        },
    },
)
Example #3
Source File: accordion.component.ts    From canopy with Apache License 2.0 5 votes vote down vote up
LG_ACCORDION = new InjectionToken<LgAccordionComponent>('LG_ACCORDION')
Example #4
Source File: globalSettings.ts    From ngx-dynamic-hooks with MIT License 5 votes vote down vote up
DYNAMICHOOKS_GLOBALSETTINGS = new InjectionToken<DynamicHooksGlobalSettings>('The global settings for the DynamicHooks module.')
Example #5
Source File: variables.ts    From barista with Apache License 2.0 5 votes vote down vote up
BASE_PATH = new InjectionToken<string>('basePath')
Example #6
Source File: greeter.class.ts    From Angular-Cookbook with MIT License 5 votes vote down vote up
GREETER = new InjectionToken('Greeter', {
  providedIn: 'root',
  factory: () => Greeter,
})
Example #7
Source File: activator.snippets.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 5 votes vote down vote up
ACTIVATOR = new InjectionToken<any[]>('ACTIVATOR')
Example #8
Source File: dialog.service.ts    From alauda-ui with MIT License 5 votes vote down vote up
DIALOG_DATA = new InjectionToken<any>('aui-dialog-data')
Example #9
Source File: search-config-factory.ts    From angular-padroes-e-boas-praticas with MIT License 5 votes vote down vote up
export function searchConfigFactoryToken<T>(searchConfig: SearchConfig<T>): InjectionToken<SearchConfigService<T>> {
  return new InjectionToken('SEARCH_CONFIG_FACTORY', {
    factory() {
      return searchConfigFactory(searchConfig);
    }
  });
}
Example #10
Source File: book-storage.service.ts    From router with MIT License 5 votes vote down vote up
LOCAL_STORAGE_TOKEN = new InjectionToken(
  'example-app-local-storage',
  { factory: storageFactory }
)
Example #11
Source File: auth.client.ts    From auth0-angular with MIT License 5 votes vote down vote up
Auth0ClientService = new InjectionToken<Auth0Client>(
  'auth0.client'
)
Example #12
Source File: auth.strategy.ts    From budget-angular with GNU General Public License v3.0 5 votes vote down vote up
AUTH_STRATEGY = new InjectionToken<AuthStrategy<any>>(
  "AuthStrategy"
)
Example #13
Source File: title.service.ts    From blockcore-hub with MIT License 5 votes vote down vote up
APP_TITLE = new InjectionToken<string>('App Title Postfix')
Example #14
Source File: edit-dialog-token.ts    From json-schema-form with Apache License 2.0 5 votes vote down vote up
EDIT_DIALOG_TOKEN: InjectionToken<ComponentType<any>> =
    new InjectionToken<ComponentType<any>>('EDIT_DIALOG_TOKEN')
Example #15
Source File: tokens.ts    From halstack-angular with Apache License 2.0 5 votes vote down vote up
DXC_RESULTSET_TABLE = new InjectionToken<any>(
  "DXC_RESULTSET_TABLE"
)
Example #16
Source File: round-progress.config.ts    From Elastos.Essentials.App with MIT License 5 votes vote down vote up
ROUND_PROGRESS_DEFAULTS =
    new InjectionToken<RoundProgressDefaults>('ROUND_PROGRESS_DEFAULTS')
Example #17
Source File: api.token.ts    From dating-client with MIT License 5 votes vote down vote up
API_URL = new InjectionToken<string>('Base API Url', {
  factory: () => environment.api
})
Example #18
Source File: title.service.ts    From EXOS-Core with MIT License 5 votes vote down vote up
APP_TITLE = new InjectionToken<string>('App Title Postfix')
Example #19
Source File: ngx-tippy.tokens.ts    From ngx-tippy-wrapper with MIT License 5 votes vote down vote up
NGX_TIPPY_MESSAGES = new InjectionToken<string>('NGX_TIPPY_MESSAGES')
Example #20
Source File: app.module.ts    From fyle-mobile-app with MIT License 5 votes vote down vote up
MIN_SCREEN_WIDTH = new InjectionToken<number>(
  'Minimum screen width to act as breakpoint between regular and small devices'
)
Example #21
Source File: variables.ts    From geonetwork-ui with GNU General Public License v2.0 5 votes vote down vote up
BASE_PATH = new InjectionToken<string>('basePath')
Example #22
Source File: color-picker.component.ts    From angular-material-components with MIT License 5 votes vote down vote up
NGX_MAT_COLOR_PICKER_SCROLL_STRATEGY =
  new InjectionToken<() => ScrollStrategy>('ngx-mat-colorpicker-scroll-strategy')
Example #23
Source File: moment-adapter.ts    From ngx-mat-datetime-picker with MIT License 5 votes vote down vote up
MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<NgxMatMomentDateAdapterOptions>(
  'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {
  providedIn: 'root',
  factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY
})
Example #24
Source File: app.providers.ts    From ngx-ui-tour with MIT License 5 votes vote down vote up
DELAY_AFTER_NAVIGATION = new InjectionToken<number>('DelayAfterNavigation', {
    factory: () => 0
})
Example #25
Source File: menu.ts    From ng-ant-admin with MIT License 5 votes vote down vote up
MENU_TOKEN = new InjectionToken<Menu[]>('menu-token', {
  providedIn: 'root', factory(): Menu[] {
    return menuNav;
  }
})
Example #26
Source File: app-initialize.ts    From elements with MIT License 5 votes vote down vote up
ConfigToken = new InjectionToken<InoElementsConfig>(
  'INOVEX_ELEMENTS_CONFIG'
)
Example #27
Source File: tokens.ts    From angular-dream-stack with MIT License 5 votes vote down vote up
AVAILABLE_APPS = new InjectionToken<{
  [appName: string]: AppRegistration;
}>('Available Apps')
Example #28
Source File: form.tokens.ts    From open-source with MIT License 5 votes vote down vote up
DYN_CONTROLS_TOKEN = new InjectionToken<DynControlProvider[]>(
  '@myndpm/dyn-forms/dyn-controls'
)
Example #29
Source File: pager-items-comp.ts    From ui-pager with Apache License 2.0 5 votes vote down vote up
TEMPLATED_ITEMS_COMPONENT = new InjectionToken<TemplatedItemsComponent>('TemplatedItemsComponent')