File

src/lib/components/alink/alink.component.ts

Description

Angular Component for the Alink Control.

Extends

ControlComponent

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(wmService: WebMapService, refChange: ChangeDetectorRef, render2: Renderer2, elem: ElementRef, webComponents: WebComponentsService, bringTopServ1: BringTopService)

Creates an instance of AlinkComponent.

Parameters :
Name Type Optional
wmService WebMapService No
refChange ChangeDetectorRef No
render2 Renderer2 No
elem ElementRef No
webComponents WebComponentsService No
bringTopServ1 BringTopService No

Inputs

Target
Type : string
Default value : ''

Sets the target.

Methods

clickHandler
clickHandler()

Handler for the a tag click.

Returns : void
Static NewPageEventArgsExtractor
NewPageEventArgsExtractor(event: any, component: AlinkComponent)

NewPageChange Extractor.

Parameters :
Name Type Optional
event any No
component AlinkComponent No
Returns : any

{*}

triggerPageChange
triggerPageChange(event: any)
Decorators :
@serverEvent('NewPageChange', AlinkComponent.NewPageEventArgsExtractor)

Triggers the PageChange emitter.

Parameters :
Name Type Optional
event any No
Returns : void

Properties

PageChange
Type : EventEmitter<EventData>
Default value : new EventEmitter<EventData>()

PageChange event emitter.

import {
  ChangeDetectorRef,
  Component,
  ElementRef,
  EventEmitter,
  Input,
  Optional,
  Renderer2
} from '@angular/core';
import { WebMapService } from '@mobilize/angularclient';
import {
  dataTransfer,
  BringTopService,
  EventData,
  serverEvent
} from '@mobilize/base-components';
import {
  ControlComponent,
  WebComponentsService
} from '@mobilize/winforms-components';
import { ErrorCodes, ExceptionHandlerClass } from '@mobilize/webmap-core';

/**
 * Angular Component for the Alink Control.
 *
 * @export
 * @class AlinkComponent
 * @extends {ControlComponent}
 */
@Component({
  selector: 'wm-alink',
  templateUrl: './alink.component.html',
  styleUrls: ['./alink.component.scss'],
  inputs: ['model']
})
@dataTransfer(['alnk'])
@ExceptionHandlerClass(ErrorCodes.Winforms)
export class AlinkComponent extends ControlComponent {
  /**
   * NewPageChange Extractor.
   *
   * @static
   * @param {*} event
   * @param {AlinkComponent} component
   * @return {*}  {*}
   * @memberof AlinkComponent
   */
  static NewPageEventArgsExtractor(event: any, component: AlinkComponent): any {
    return [
      null,
      { PageType: event.args.pageTarget, MapperId: 'NewPageChangeEventArgs' }
    ];
  }

  /**
   * Sets the target.
   *
   * @memberof AlinkComponent
   */
  @Input()
  Target = '';

  /**
   * PageChange event emitter.
   *
   * @type {EventEmitter<EventData>}
   * @memberof AlinkComponent
   */
  PageChange: EventEmitter<EventData> = new EventEmitter<EventData>();

  /**
   * Creates an instance of AlinkComponent.
   *
   * @param {WebMapService} wmService
   * @param {ChangeDetectorRef} refChange
   * @param {Renderer2} render2
   * @param {ElementRef} elem
   * @param {WebComponentsService} webComponents
   * @param {BringTopService} bringTopServ1
   * @memberof AlinkComponent
   */
  constructor(
    private wmService: WebMapService,
    private refChange: ChangeDetectorRef,
    private render2: Renderer2,
    private elem: ElementRef,
    webComponents: WebComponentsService,
    @Optional() private bringTopServ1: BringTopService
  ) {
    super(refChange, render2, elem, webComponents, bringTopServ1);
  }

  /**
   * Handler for the a tag click.
   *
   * @memberof AlinkComponent
   */
  clickHandler() {
    const eventData = new EventData('NewPageChange', this.id);
    eventData.args = { pageTarget: this.Target };
    this.triggerPageChange(eventData);
  }

  /**
   * Triggers the PageChange emitter.
   *
   * @param {*} event
   * @memberof AlinkComponent
   */
  @serverEvent('NewPageChange', AlinkComponent.NewPageEventArgsExtractor)
  triggerPageChange(event: any): void {
    this.PageChange.emit(new EventData(event, this.id));
  }
}
<a href="javascript:void(0)" (click)="clickHandler()" [ngClass]="class" wmControls [hostComponent]="this">
    <ng-content></ng-content>
</a>

./alink.component.scss

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""