import { Component, ElementRef, OnInit, Input, Output, EventEmitter, HostBinding } from '@angular/core';
import { FabModel } from '../../models/fab/fab.model';
import { FabButtonModel } from '../../models/fab/fab-button.model';
import { CfCoreComponent } from '../core/core.component';
@Component({
selector: 'cf-fab',
template: "
It is Object which will recive data from FabModel Class. It is used in cf-fab template.
*Example:
*{
* direction: "down",
* showButtons: true,
* stayOpened: true,
* triggerButton: { icon: {name: 'fa-gear'} },
* actionButtons: [
* { icon: {name:"fa-apple"}, display: this.shown },
* { icon: {name:"fa-star"}, label: "Item", labelPosition: "left" },
* { icon: {name:"fa-home"}, disabled: this.disabled }
* ]
* }
* It is function to send event with Fab trigger button object when it was clciked.
*Example of event object:
* @param item it is trigger button object */ coreTriggerEvent(fab: Object) { this.cfTriggerEvent.emit(fab); } /** *It is function to send event with Fab action button object when it was clciked.
*Example of event object:
* @param index it is index of action button * @param item it is action button object */ coreActionEvent(fab: Object) { this.cfActionButtonEvent.emit(fab); } public constructor(public elementRef: ElementRef) { super(elementRef); } /** * It will be generated cfFab object and rendered inside component template. */ ngOnInit(){ this.cfFab = this.properties; // if(this.notificationAction.observers.length>0) this.notifacationClickable = 'notification-clickable'; } }