Class: Popup service:ngeoCreatePopup

Provides a factory to create a popup in the page. The factory returns a ngeo.message.Popup object.

Example:

let popup = ngeoCreatePopup();
popup.setTitle("A title");
popup.setContent("Some content");
popup.setOpen(true);
Parameters:
Name Type Description
$compile angular.$compile

The compile provider.

$rootScope angular.Scope

The rootScope provider.

$sce angular.$sce

Angular sce service.

$timeout angular.$timeout

Angular timeout service.

Members

(static) module: angular.Module

scope: angular.Scope

The scope the compiled element is link to.

Methods

(static) Factory($compile, $rootScope, $sce, $timeout)

Parameters:
Name Type Description
$compile angular.$compile

Angular compile service.

$rootScope angular.Scope

Angular rootScope service.

$sce angular.$sce

Angular sce service.

$timeout angular.$timeout

Angular timeout service.

Returns:
ngeox.PopupFactory

The function to create a popup.

addClass(cls)

Add an extra CSS class name to the popup.

Parameters:
Name Type Description
cls string

Class name to add to the popup element.

destroy()

Destroy the popup.

getOpen()

Get the current popup state.

Returns:
boolean

true if the popup is currently, otherwise false.

open(options)

Open a popup with the given properties.

Parameters:
Name Type Description
options ngeox.PopupOptions

Options.

setAutoDestroy(autoDestroy)

Set the popup's autoDestroy property.

Parameters:
Name Type Description
autoDestroy boolean

Whether to automatically destroy the popup when being closed or not.

setContent(content, [opt_trusted]opt)

Set the popup's content. Note: the type of the content param is * instead of string, this is because the content may be trusted using $sce.trustAsHtml.

Parameters:
Name Type Attributes Description
content *

The content.

[opt_trusted] boolean= <optional>

Whether the content can be trusted. Default is false.

setHeight(height)

Set the popup's height.

Parameters:
Name Type Description
height string

Height the popup should have.

setOpen(open)

Show/hide the popup.

Parameters:
Name Type Description
open boolean

true to show the popup, false to hide it.

setSize(width, height)

Set the popup's width and height.

Parameters:
Name Type Description
width string

Width the popup should have.

height string

Height the popup should have.

setTitle(title)

Set the popup's title.

Parameters:
Name Type Description
title string

The title.

setUrl(url)

Set the popup's content with an iframe using the given url.

Parameters:
Name Type Description
url string

The url of the page.

setWidth(width)

Set the popup's width.

Parameters:
Name Type Description
width string

Width the popup should have.