@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
37 lines (33 loc) • 1.2 kB
JavaScript
import { inject } from '@angular/core';
import { hookNavigator, NavigatorNode, hookRoute, AppStateService, ViewContext } from '@c8y/ngx-components';
import { gettext } from '@c8y/ngx-components/gettext';
const featureTogglePath = 'feature-toggles';
const featureToggleProviders = [
hookNavigator(new NavigatorNode({
path: featureTogglePath,
label: gettext('Feature toggles'),
icon: 'toggle-on',
parent: 'Settings'
})),
hookRoute({
path: featureTogglePath,
context: ViewContext.Tenant,
loadChildren: () => import('@c8y/ngx-components/feature-toggles/list').then(m => m.childRoutes),
icon: 'toggle-on',
label: gettext('Feature toggles'),
canActivate: [
() => {
return inject(AppStateService).currentTenant.value?.name === 'management';
}
]
}),
hookRoute({
path: featureTogglePath,
loadChildren: () => import('@c8y/ngx-components/feature-toggles/list').then(m => m.childRoutes)
})
];
/**
* Generated bundle index. Do not edit.
*/
export { featureToggleProviders };
//# sourceMappingURL=c8y-ngx-components-feature-toggles.mjs.map