File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -8,19 +8,15 @@ export class ConfigurationProvider<T> {
88 constructor ( ) {
99 this . mergedConfiguration = < T > { } ;
1010
11- this . addObject ( ( < any > window ) . webConfig , true ) ;
12- this . addObject ( ( < any > window ) . configuration , true ) ;
11+ this . addConfiguration ( ( < any > window ) . webConfig , true ) ;
12+ this . addConfiguration ( ( < any > window ) . configuration , true ) ;
1313 }
1414
1515 public $get ( $q : angular . IQService ) {
1616 return this . mergedConfiguration ;
1717 }
1818
19- public get ( ) : T {
20- return this . mergedConfiguration ;
21- }
22-
23- public addObject ( obj : any , optional ?: boolean ) {
19+ public addConfiguration ( obj : T , optional ?: boolean ) {
2420 if ( obj ) {
2521 this . mergedConfiguration = < T > merge ( this . mergedConfiguration , obj ) ;
2622 } else {
@@ -34,7 +30,7 @@ export class ConfigurationProvider<T> {
3430 * Add a default object that will only add params that aren't already specified
3531 * @param obj
3632 */
37- public addDefaultObject ( obj : any ) {
33+ public addDefaultObject ( obj : T ) {
3834 if ( obj ) {
3935 this . mergedConfiguration = < T > merge ( obj , this . mergedConfiguration ) ;
4036 }
Original file line number Diff line number Diff line change 11'use strict' ;
22import { ConfigurationProvider } from "gl-angular-configuration/package/src/ConfigurationProvider" ;
3-
4- interface ITestAppConfiguration {
5- env : string
6- }
3+ import { ITestAppConfiguration } from "./configuration/ITestAppConfiguration.d.ts" ;
74
85export class Config {
96 /** @ngInject */
107 constructor ( configurationProvider : ConfigurationProvider < ITestAppConfiguration > ) {
118
129 // you can add configuration objects in the configuration function of Angular
13- configurationProvider . addObject ( { otherParam : 'test' } ) ;
10+ configurationProvider . addConfiguration ( { otherParam : 'test' } ) ;
1411 }
1512}
You can’t perform that action at this time.
0 commit comments