Skip to content

Instantly share code, notes, and snippets.

@SaladFork
Last active September 7, 2016 20:21
Show Gist options
  • Save SaladFork/f8f3149a6f5fbc2d377bbed532bf3a62 to your computer and use it in GitHub Desktop.
Save SaladFork/f8f3149a6f5fbc2d377bbed532bf3a62 to your computer and use it in GitHub Desktop.
hasBlock property
import Ember from 'ember';
export default Ember.Component.extend({
click() {
window.alert(this.get('hasBlock'));
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>JavaScript <code>hasBlock</code></h1>
{{#my-component}}
Click Me (will alert <code>hasBlock</code>)
{{/my-component}}
{{yield}}
<br>
hasBlock: {{hasBlock}}
<br>
{{#if hasBlock}}
I have a block
{{/if}}
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment