Skip to content

Instantly share code, notes, and snippets.

@hbrysiewicz
Last active March 31, 2017 22:46
Show Gist options
  • Save hbrysiewicz/d4e4aad8932df3c2bee9ea49ca173875 to your computer and use it in GitHub Desktop.
Save hbrysiewicz/d4e4aad8932df3c2bee9ea49ca173875 to your computer and use it in GitHub Desktop.
Inline SVG - Part 1
import Ember from 'ember'
const {
Component,
computed: { alias }
} = Ember
export default Ember.Component.extend({
attributeBindings: [
'data',
'type'
],
tagName: 'object',
type: 'image/svg+xml',
data: alias('model.url')
})
import Ember from 'ember'
const {
Controller,
computed
} = Ember
export default Controller.extend({
appName: 'Ember Inline SVG - Step 1',
models: computed(function() {
let models = []
for (let i = 0; i < 70; i++) {
models.push({
url: 'https://hbrysiewicz.com/assets/img/ember.svg'
})
}
return models
})
})
<style>
body {
background-color: #9a9a9a;
}
</style>
{{#each models as |model|}}
{{clickable-svg model=model}}
{{/each}}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment