Last active
August 20, 2016 16:41
-
-
Save Robdel12/cf265903963f13574d52ac607c246a30 to your computer and use it in GitHub Desktop.
JSON Parse ember object to clone?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
stringify: Ember.computed(function() { | |
let stringify = JSON.stringify(EmberObject); | |
return stringify; | |
}), | |
parse: Ember.computed('stringify', function() { | |
let parse = JSON.parse(this.get('stringify')); | |
return parse; | |
}) | |
}); | |
const EmberObject = Ember.Object.create({ | |
hey: "ho", | |
lets: "go" | |
}); | |
EmberObject.reopen({ | |
combined: Ember.computed('hey', 'lets', function() { | |
return `hey ${this.get('hey')}, lets ${this.get('lets')}`; | |
}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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