[Example] Add iframe example plugin

Add example plugin with iframe; relates to WTD-1030, generally.
This commit is contained in:
Victor Woeltjen 2015-04-23 14:04:03 -07:00
parent daabe4312d
commit 6e24052a3d
3 changed files with 56 additions and 0 deletions

View 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"]
}
]
}
}

View File

@ -0,0 +1,4 @@
<iframe ng-controller="IFrameController as ctl"
style="width: 100%; height: 100%;"
ng-src="{{ctl.trust(model.url)}}">
</iframe>

View File

@ -0,0 +1,19 @@
/*global define*/
define(
[],
function () {
"use strict";
function Controller($sce) {
return {
trust: function (url) {
return $sce.trustAsResourceUrl(url);
}
};
}
return Controller;
}
);