Skip to content

Instantly share code, notes, and snippets.

@sagaban
Created June 2, 2016 06:48
Show Gist options
  • Save sagaban/f8b4a62ab8459140529897d7214c33b5 to your computer and use it in GitHub Desktop.
Save sagaban/f8b4a62ab8459140529897d7214c33b5 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return Ember.Object.create({
title: "título",
author: "Yo author",
body: "cuerpo"
});
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
-I-
{{#blog-post post=model as |title author body |}}
<h2>{{title}}</h2>
<p class="author">by: {{author}}</p>
<div class="post-body">{{body}}</div>
{{/blog-post}}
<br>
-II-
{{blog-post post=model}}
<br>
<br>
{{#if hasBlock}}
-block-
{{yield post.title post.author post.body
}}
{{else}}
-line-
<h1>{{post.title}}</h1>
<p class="author">Authored by {{post.author}}</p>
<p>{{post.body}}</p>
{{/if}}
{
"version": "0.8.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.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment