Skip to content

Instantly share code, notes, and snippets.

@KTKate
Created July 15, 2015 23:05
Show Gist options
  • Save KTKate/6d55ac7ed4e92b26a165 to your computer and use it in GitHub Desktop.
Save KTKate/6d55ac7ed4e92b26a165 to your computer and use it in GitHub Desktop.
New Twiddle
export default Ember.Component.extend({
unicorn: "default",
click: function() {
const strngs = ['i', 'want', 'to', 'go', 'home'];
this.attrs.unicorn.update(
strngs[Math.floor(Math.random()*strngs.length)]
);
}
});
<h4>Component Value:</h4>
Unicorn: {{unicorn}}<br>
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
narwhal: "controller"
});
import Ember from 'ember';
var Router = Ember.Router.extend({
location: 'none'
});
Router.map(function() {
});
export default Router;
body { margin: 12px 16px }
<div style="font-family: Arial">
<h2>Click on the words</h2>
<h4>Controller Values:</h4>
Narwhal: {{narwhal}}
{{foo-bar unicorn=(mut narwhal)}}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment