mirror of
https://github.com/nasa/openmct.git
synced 2025-04-07 11:26:49 +00:00
[Example] Add iframe example plugin
Add example plugin with iframe; relates to WTD-1030, generally.
This commit is contained in:
parent
daabe4312d
commit
6e24052a3d
33
example/iframe/bundle.json
Normal file
33
example/iframe/bundle.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"extensions": {
|
||||
"types": [
|
||||
{
|
||||
"key": "example.page",
|
||||
"name": "Page",
|
||||
"features": [ "creation" ],
|
||||
"properties": [
|
||||
{
|
||||
"key": "url",
|
||||
"name": "URL",
|
||||
"control": "textfield"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"views": [
|
||||
{
|
||||
"templateUrl": "iframe.html",
|
||||
"name": "Page",
|
||||
"type": "example.page",
|
||||
"key": "example.page"
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
{
|
||||
"key": "IFrameController",
|
||||
"implementation": "IFrameController.js",
|
||||
"depends": ["$sce"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
4
example/iframe/res/iframe.html
Normal file
4
example/iframe/res/iframe.html
Normal file
@ -0,0 +1,4 @@
|
||||
<iframe ng-controller="IFrameController as ctl"
|
||||
style="width: 100%; height: 100%;"
|
||||
ng-src="{{ctl.trust(model.url)}}">
|
||||
</iframe>
|
19
example/iframe/src/IFrameController.js
Normal file
19
example/iframe/src/IFrameController.js
Normal file
@ -0,0 +1,19 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
function Controller($sce) {
|
||||
return {
|
||||
trust: function (url) {
|
||||
return $sce.trustAsResourceUrl(url);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return Controller;
|
||||
}
|
||||
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user