-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(collapse): add 'NgbCollapseConfig' (#3736)
- Loading branch information
1 parent
0416a6a
commit 8d5417a
Showing
5 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {NgbConfig} from '../ngb-config'; | ||
import {NgbCollapseConfig} from './collapse-config'; | ||
|
||
describe('ngb-collapse-config', () => { | ||
it('should have sensible default values', () => { | ||
const config = new NgbConfig(); | ||
const collapseConfig = new NgbCollapseConfig(config); | ||
|
||
expect(collapseConfig.animation).toBe(config.animation); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {Injectable} from '@angular/core'; | ||
import {NgbConfig} from '../ngb-config'; | ||
|
||
/** | ||
* A configuration service for the [NgbCollapse](#/components/collapse/api#NgbCollapse) component. | ||
* | ||
* You can inject this service, typically in your root component, and customize its properties | ||
* to provide default values for all collapses used in the application. | ||
*/ | ||
@Injectable({providedIn: 'root'}) | ||
export class NgbCollapseConfig { | ||
animation: boolean; | ||
|
||
constructor(ngbConfig: NgbConfig) { this.animation = ngbConfig.animation; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters