all files / component/sidenav/ sidenav.service.ts

76.92% Statements 10/13
100% Branches 0/0
40% Functions 2/5
72.73% Lines 8/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                                 
/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
import { Injectable } from '@angular/core';
 
@Injectable()
export class DejaSidenavService {
 
    public opened: boolean;
    public mode: 'over' | 'side' = 'side';
    public hidden = false;
 
    constructor() { }
 
    public open(): void {
        this.opened = true;
    }
 
    public close(): void {
        this.opened = false;
    }
 
    public toggle(): void {
        this.opened = !this.opened;
    }
 
}