Moved config to ngConstant to mount that from outside the container
Change-Id: I23169cdeeae9034ea97e94089dcdbca3179bbb23
diff --git a/src/app/core/footer/footer.spec.ts b/src/app/core/footer/footer.spec.ts
index 06c1044..4193bc9 100644
--- a/src/app/core/footer/footer.spec.ts
+++ b/src/app/core/footer/footer.spec.ts
@@ -3,13 +3,18 @@
import * as angular from 'angular';
import 'angular-mocks';
import {xosFooter} from './footer';
-import {StyleConfig} from '../../config/style.config';
+
+const MockStyleConfig = {
+ projectName: 'CORD'
+};
describe('footer component', () => {
beforeEach(() => {
angular
.module('xosFooter', ['app/core/footer/footer.html'])
- .component('xosFooter', xosFooter);
+ .component('xosFooter', xosFooter)
+ .constant('StyleConfig', MockStyleConfig);
+
angular.mock.module('xosFooter');
});
@@ -17,6 +22,6 @@
const element = $compile('<xos-footer></xos-footer>')($rootScope);
$rootScope.$digest();
const footer = element.find('a');
- expect(footer.html().trim()).toEqual(`${StyleConfig.projectName} Team`);
+ expect(footer.html().trim()).toEqual(`${MockStyleConfig.projectName} Team`);
}));
});
diff --git a/src/app/core/footer/footer.ts b/src/app/core/footer/footer.ts
index 77a223b..e5fbe3f 100644
--- a/src/app/core/footer/footer.ts
+++ b/src/app/core/footer/footer.ts
@@ -1,11 +1,15 @@
-import {StyleConfig} from '../../config/style.config';
-
+import {IXosStyleConfig} from '../../../index';
class FooterCtrl {
+
+ static $inject = ['StyleConfig'];
+
public brand: string;
/** @ngInject */
- constructor() {
- this.brand = StyleConfig.projectName;
+ constructor(
+ private StyleConfig: IXosStyleConfig
+ ) {
+ this.brand = this.StyleConfig.projectName;
}
}