Skip to content

Instantly share code, notes, and snippets.

@robomalo
Forked from thousand/components.entity-figure.js
Last active September 25, 2019 22:48
Show Gist options
  • Save robomalo/6c8faf8301f6fea6b7c587a059b2641c to your computer and use it in GitHub Desktop.
Save robomalo/6c8faf8301f6fea6b7c587a059b2641c to your computer and use it in GitHub Desktop.
Entity sample
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
});
<h2>Has image</h2>
{{#entity-figure}}
{{#if true}}
<img src="https://placekitten.com/100/100" alt="kitty">
{{/if}}
{{/entity-figure}}
<h2>No image</h2>
{{entity-figure}}
{{#entity-figure}}
{{#if false}}
<img src="https://placekitten.com/100/100" alt="kitty">
{{/if}}
{{/entity-figure}}
{{#if hasBlock}}
{{yield}}
{{else}}
<img src="http://www.myiconfinder.com/uploads/iconsets/256-256-8f47e792bc78fa4b0a2afd1b439129c9-ghost.png" alt="ghost" height=100 width=100>
{{/if}}
{{#if hasBlock}}
{{#entity-figure}}
{{yield}}
{{/enity-figure}}
{{/if}}
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment