Skip to content

Instantly share code, notes, and snippets.

@bbansalWolfPack
Last active July 7, 2019 02:54
Show Gist options
  • Save bbansalWolfPack/ce5a1185d39663c0a8a05781a1fde0db to your computer and use it in GitHub Desktop.
Save bbansalWolfPack/ce5a1185d39663c0a8a05781a1fde0db to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
import { task, timeout } from 'ember-concurrency';
export default Ember.Component.extend({
init() {
this._super();
this.set('isStudentSignedIn', true);
}
});
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('showSection', true);
},
didReceiveAttrs(){
this._super();
console.log("logging showSection property");
console.log(this.get('showSection'));
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
isStudentSignedIn: false,
showSection: false,
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{parent-component
isStudentSignedIn=isStudentSignedIn
showSection=showSection
}}
<br>
<br>
{{yield}}
<p> in child component </p>
{{yield}}
<p> in parent component </p>
{{#if showSection}}
{{child-component
isStudentSignedIn=isStudentSignedIn
}}
{{/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": "2.12.2",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "2.11.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment