Skip to content

Commit

Permalink
feat: add global 'NgbConfig' (#3715)
Browse files Browse the repository at this point in the history
Co-authored-by: fbasso <fabrice.basso@amadeus.com>
  • Loading branch information
maxokorokov and fbasso committed May 3, 2020
1 parent ea59f88 commit bf9b98d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"fileReplacements": [
{
"src": "src/environment.ts",
"replaceWith": "src/environment.test.ts"
}
],
"main": "src/test.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
Expand Down Expand Up @@ -370,4 +376,4 @@
"packageManager": "yarn",
"analytics": false
}
}
}
3 changes: 3 additions & 0 deletions src/environment.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
animation: false,
};
3 changes: 3 additions & 0 deletions src/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
animation: true,
};
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ export {
} from './typeahead/typeahead.module';
export {Placement} from './util/positioning';

export {NgbConfig} from './ngb-config';


const NGB_MODULES = [
NgbAccordionModule, NgbAlertModule, NgbButtonsModule, NgbCarouselModule, NgbCollapseModule, NgbDatepickerModule,
Expand Down
7 changes: 7 additions & 0 deletions src/ngb-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Injectable} from '@angular/core';
import {environment} from './environment';

@Injectable({providedIn: 'root'})
export class NgbConfig {
animation = environment.animation;
}

0 comments on commit bf9b98d

Please sign in to comment.