Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/cuba-app/cuba-app-aware-behavior.html">
Polymer element for displaying image from CUBA app file storage.
<myapp-fd-img file-descriptor="[[]]"></myapp-fd-img>
<dom-module id="myapp-fd-img">
:host {
display: inline-block;
<img src="[[_computeSrc(app, fileDescriptor)]]">
is: 'myapp-fd-img',
behaviors: [CubaAppAwareBehavior],
properties: {
fileDescriptor: {
type: Object
_computeSrc: function(app, fileDescriptor) {
if (app && fileDescriptor) {
var url = app.apiUrl + 'v2/files/' +;
if (app.restApiToken) {
url += '?access_token=' + app.restApiToken;
return url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment