UNPKG

@anglr/notifications

Version:
34 lines 1.23 kB
import { makeEnvironmentProviders } from '@angular/core'; import { isPresent } from '@jscrpt/common'; import { GLOBAL_NOTIFICATIONS, LOCAL_NOTIFICATIONS } from '../common/notifications.service'; /** * Provides global notifications service * @param name - Name for global notifications scope * @param customNotificationsToken - Optional type or token that should be provided for custom notifications */ export function provideGlobalNotifications(name, customNotificationsToken) { if (isPresent(name)) { return makeEnvironmentProviders([ GLOBAL_NOTIFICATIONS.named(name, customNotificationsToken), ]); } return makeEnvironmentProviders([ GLOBAL_NOTIFICATIONS, ]); } /** * Provides local notifications service * @param name - Name for local notifications scope * @param customNotificationsToken - Optional type or token that should be provided for custom notifications */ export function provideLocalNotifications(name, customNotificationsToken) { if (isPresent(name)) { return [ LOCAL_NOTIFICATIONS.named(name, customNotificationsToken), ]; } return [ LOCAL_NOTIFICATIONS, ]; } //# sourceMappingURL=providers.js.map