new Popup($compile, $rootScope, $sce, $timeout)
Provides a factory to create a popup in the page. The factory returns a ngeo.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
scope: angular.Scope
The scope the compiled element is link to.
Methods
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:
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 |
|
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. |