@WidgetComponent

nm-icon-cell

File

src/app/shared/widgets/imarket/list-cell-icon/icon-widget.component.ts

Implements

CellWidget

Metadata

selector nm-icon-cell
styleUrls icon-widget.component.scss
templateUrl ./icon-widget.component.html

Index

Widget inputs
Widget outputs
Properties
Methods

Methods

Protected configureWidget
configureWidget(configuration: WidgetConfig)
Decorators : WidgetConfigure
Parameters :
Name Type Optional
configuration WidgetConfig<IconWidgetConfiguration> no
Returns : void

Properties

Public configuration
configuration: WidgetConfig<IconWidgetConfiguration>
Type : WidgetConfig<IconWidgetConfiguration>
Decorators : WidgetConfiguration
Public flagIcons
flagIcons: boolean
Type : boolean
Public row
row: any
Type : any
Public selectedIcon
selectedIcon: Subject<any>
Type : Subject<any>
Default value : new Subject<any>()
Decorators : WidgetOutput
import { Component } from "@angular/core";
import {
  WidgetComponent,
  WidgetConfiguration,
  WidgetConfigure,
  WidgetOutput,
} from "../../widget.metadata";
import { WidgetConfig, getOrDefault } from "../../widget.configuration";
import { BaseConfiguration } from "../../../widgets/widgetframe/widgetframe.component";
import { CellWidget } from "../../../components/list-cell";
import { Subject } from "rxjs";

export interface IconWidgetConfiguration extends BaseConfiguration {
  svg?: boolean;
  flagIcons: boolean;
}

@WidgetComponent("nm-icon-cell")
@Component({
  selector: "nm-icon-cell",
  templateUrl: "./icon-widget.component.html",
  styleUrls: ["./icon-widget.component.scss"],
})
export class IconWidgetComponent implements CellWidget {
  public row: any;
  public flagIcons: boolean;

  @WidgetOutput("selectedIcon")
  public selectedIcon: Subject<any> = new Subject<any>();

  @WidgetConfiguration()
  public configuration: WidgetConfig<IconWidgetConfiguration>;

  @WidgetConfigure()
  protected configureWidget(
    configuration: WidgetConfig<IconWidgetConfiguration>
  ) {
    this.flagIcons = getOrDefault(
      this.configuration.configuration.flagIcons,
      false
    );
  }
}
<nm-icon [data]="row" [flagIcons]="flagIcons" (selectedIcon)="selectedIcon.next($event)"></nm-icon>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""