File

src/app/modules/shared/components/card/card.component.ts

Metadata

selector app-card
templateUrl card.component.html

Inputs

customClass

Type: string

data

content is used to render IContents value on the view

Type: ICard

dialCode

Type: string

Outputs

clickEvent $event type: EventEmitter

Constructor

constructor(resourceService: ResourceService, router: Router)

Methods

Public onAction
onAction(data: any, action: any)
Returns: void

Properties

hover
hover: Boolean
isConnected
isConnected: Boolean
resourceService
resourceService: ResourceService
route
route: string
telemetryCdata
telemetryCdata: {}[]
import { ResourceService } from '../../services/index';
import { Component, OnInit, Input, EventEmitter, Output, HostListener } from '@angular/core';
import { ICard } from '../../interfaces';
import { IImpressionEventInput, IInteractEventObject } from '@sunbird/telemetry';
import { Router } from '@angular/router';
import * as _ from 'lodash-es';

@Component({
  selector: 'app-card',
  templateUrl: './card.component.html'
})
export class CardComponent {
  /**
  * content is used to render IContents value on the view
  */
  @Input() data: ICard;
  @Input() dialCode: string;
  @Input() customClass: string;
  @Output() clickEvent = new EventEmitter<any>();
  telemetryCdata: Array<{}> = [];
  hover: Boolean;
  isConnected: Boolean = navigator.onLine;
  route: string;

  constructor(public resourceService: ResourceService, private router: Router) {
    this.resourceService = resourceService;
    if (this.dialCode) {
      this.telemetryCdata = [{ 'type': 'DialCode', 'id': this.dialCode }];
    }
    this.route = this.router.url;
  }

  public onAction(data, action) {
    this.clickEvent.emit({ 'action': action, 'data': data });
  }
}

results matching ""

    No results matching ""