Added possiblity to extend the dashboard programmatically
Change-Id: Ibf2c2f7e6d51e6f5a661021f3f9f4b15c9cbefa1
diff --git a/src/app/core/nav/nav.ts b/src/app/core/nav/nav.ts
index ec2d8b2..08ad48a 100644
--- a/src/app/core/nav/nav.ts
+++ b/src/app/core/nav/nav.ts
@@ -3,9 +3,10 @@
import {IXosAuthService} from '../../datasources/rest/auth.rest';
import {IXosStyleConfig} from '../../../index';
import {IXosSidePanelService} from '../side-panel/side-panel.service';
+import {IXosComponentInjectorService} from '../services/helpers/component-injector.helpers';
class NavCtrl {
- static $inject = ['$scope', '$state', 'NavigationService', 'AuthService', 'StyleConfig', 'XosSidePanel'];
+ static $inject = ['$scope', '$state', 'NavigationService', 'AuthService', 'StyleConfig', 'XosSidePanel', 'XosComponentInjector'];
public routes: IXosNavigationRoute[];
public navSelected: string;
public appName: string;
@@ -17,7 +18,8 @@
private navigationService: IXosNavigationService,
private authService: IXosAuthService,
private StyleConfig: IXosStyleConfig,
- private XosSidePanel: IXosSidePanelService
+ private XosSidePanel: IXosSidePanelService,
+ private XosComponentInjector: IXosComponentInjectorService
) {
// NOTE we'll need to have:
// - Base routes (defined from configuration based on BRAND)
@@ -62,6 +64,9 @@
togglePanel() {
this.XosSidePanel.injectComponent('xosAlert', {config: {type: 'danger'}, show: true}, 'Sample message');
}
+ addToDashboard() {
+ this.XosComponentInjector.injectComponent('#dashboard-component-container', 'xosAlert', {config: {type: 'danger'}, show: true}, 'Sample message', false);
+ }
logout() {
this.authService.logout()