Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Last active August 17, 2016 11:32
Show Gist options
  • Save kumkanillam/e1027fc1c31c1ff66d8c95989fdb6c88 to your computer and use it in GitHub Desktop.
Save kumkanillam/e1027fc1c31c1ff66d8c95989fdb6c88 to your computer and use it in GitHub Desktop.
Demo - RSVP hash Access
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions:{
save(){
console.log(' cont save');
return true;
}
}
});
import Ember from 'ember';
export default Ember.Route.extend({
model(){
//return {'newBook':{one:1},'authors':{two:2}};
return Ember.RSVP.hash({'newBook':{one:1},'authors':{two:2}});
},
actions:{
save(){
console.log(' route save ',this.modelFor(this.routeName).newBook);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<button {{action "save" }}> Test </button>
<br>
{{outlet}}
<br>
<br>
{
"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