import {Component, OnInit, Input} from '@angular/core';

@Component({
    selector: 'app-permisos',
    templateUrl: './permisos.component.html'
})
export class PermisosComponent implements OnInit {

    @Input() permissions: any[] = [];
    select : boolean = true;
    constructor() {
    }

    ngOnInit() {
    }

    selectAll() {
        this.permissions.forEach((v, i) => {
            if (this.select) {
                v.value = true;
            } else {
                v.value = false;
            }
        });
        this.select = !this.select;
    }

}
