Skip to content

Instantly share code, notes, and snippets.

@mohamedali-s-4725
Last active July 19, 2021 06:27
Show Gist options
  • Save mohamedali-s-4725/e62b8d51f5f70009d4b90e5fe23392aa to your computer and use it in GitHub Desktop.
Save mohamedali-s-4725/e62b8d51f5f70009d4b90e5fe23392aa to your computer and use it in GitHub Desktop.
Data-Down sync
import Component from '@ember/component';
import layout from '../templates/components/my-component';
export default Component.extend({
layout,
options: {
option1: 'value1',
option2: 'value2',
option3: 'value3',
option4: 'value4'
}
});
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
<h1>Welcome to {{this.appName}}</h1>
<br>
<h4> <u>No Data-down : </u></h4> <br>
<MyComponent/>
<hr>
<br> <h4><u>With Data-down of hash helper : </u></h4> <br>
<MyComponent
@options={{hash option1='SMA' }}
/>
{{outlet}}
<br>
<br>
{{options.option1}} <br><br>
{{options.option2}} <br><br>
{{options.option3}} <br><br>
{{options.option4}} <br><br>
{{yield}}
{
"version": "0.17.1",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false,
"_APPLICATION_TEMPLATE_WRAPPER": true,
"_JQUERY_INTEGRATION": true
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js",
"ember": "3.11.1",
"ember-template-compiler": "3.11.1",
"ember-testing": "3.11.1"
},
"addons": {
"@glimmer/component": "1.0.0",
"ember-data": "3.11.5"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment