Skip to content

Commit

Permalink
feat(nav): nav config animations
Browse files Browse the repository at this point in the history
  • Loading branch information
maxokorokov committed Jul 2, 2020
1 parent 336e37a commit 262ac7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nav/nav-config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {NgbNavConfig} from './nav-config';
import {NgbConfig} from '../ngb-config';

describe('ngb-nav-config', () => {
it('should have sensible default values', () => {
const config = new NgbNavConfig();
const ngbConfig = new NgbConfig();
const config = new NgbNavConfig(ngbConfig);

expect(config.animation).toBe(ngbConfig.animation);
expect(config.destroyOnHide).toBe(true);
expect(config.orientation).toBe('horizontal');
expect(config.roles).toBe('tablist');
Expand Down
4 changes: 4 additions & 0 deletions src/nav/nav-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Injectable} from '@angular/core';
import {NgbConfig} from '../ngb-config';

/**
* A configuration service for the [`NgbNav`](#/components/nav/api#NgbNav) component.
Expand All @@ -10,8 +11,11 @@ import {Injectable} from '@angular/core';
*/
@Injectable({providedIn: 'root'})
export class NgbNavConfig {
animation: boolean;
destroyOnHide = true;
orientation: 'horizontal' | 'vertical' = 'horizontal';
roles: 'tablist' | false = 'tablist';
keyboard: boolean | 'changeWithArrows' = false;

constructor(ngbConfig: NgbConfig) { this.animation = ngbConfig.animation; }
}

0 comments on commit 262ac7d

Please sign in to comment.