import { Component, Input, Output, EventEmitter } from "@angular/core";
import { Content } from "ionic-angular";

@Component({
    selector: "omaster-footer",
    templateUrl: "omaster-footer.html"
    // viewProviders: [ Content ]
})
export class OMasterFooter {

    @Input()
    hasElements: boolean;

    @Output()
    create: EventEmitter<any>;

    @Output()
    more: EventEmitter<any>;

    constructor() { 
        this.hasElements = false;
        this.create = new EventEmitter();
        this.more = new EventEmitter();
    }

    /**
     *
     */
    showEmptyMessage(): boolean {
        return !this.hasElements;
    }

    /**
     *
     */
    createNewElement(event): void {
        this.create.emit(event);
    }

    /**
     *
     */
    showMoreElements(event): void {
        this.more.emit(event);
    }
}