Skip Navigation

IAreaService

Allows to manipulate work Area.
Currently service supports:

  • banners,

area service banners
  • getting current PCC.

Acquiring service

In order to obtain IAreaService and use it, you need to import it:

import {IAreaService} from 'sabre-ngv-app/app/services/impl/IAreaService';

Then obtain the service inside your source as below:

const areaService: IAreaService = getService(IAreaService);

Available methods

Currently available methods:

getActiveArea
getActiveArea(): string;

Returns active Area.

Returns:
string

showBanner
showBanner(config: BannerConfig): void;
  • config - Config of banner to be displayed

Allows to show a banner in work Area.

Config Parameteres:

interface BannerConfig {
    type?: BannerType;
    text: string;
    title?: string;
    label?: string;
    action?: () => void;
}
  • [type] - Type of banner to be displayed. Info is default (optional)

type BannerType = 'Info' | 'Warning' | 'Success' | 'Error';
  • text - Text to be displayed on the banner (passing an empty string may result in a text that does not make sense, the text is capitalised)

  • [title] - Title of the banner (optional, the title is capitalised)

  • [label] - Label of button. If it is not defined, the button will not be displayed (optional)

  • [action] - Function that will be performed when the button is pressed (optional)

Returns:
void

getCurrentPcc
getCurrentPcc(): string;

Returns current PCC in work Area.

Returns:
string

clear
clear(): void;

Clears current work area.

Returns:
void

Example

You can see example usage in com.sabre.redapp.example3.web.customworkflow sample.