Skip to content

Instantly share code, notes, and snippets.

@benoror
Last active July 19, 2016 18:02
Show Gist options
  • Save benoror/2b4153485490b0f472a959528cf105b7 to your computer and use it in GitHub Desktop.
Save benoror/2b4153485490b0f472a959528cf105b7 to your computer and use it in GitHub Desktop.
ember-jsoneditor/issues/13
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('test');
this.route('other');
});
export default Router;
import Ember from 'ember';
const {
set
} = Ember;
export default Ember.Route.extend({
model() {
return ['a', {'b': 'c'}];
},
setupController(controller, model) {
set(controller, 'fields', model);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#link-to 'test'}}test route{{/link-to}}
{{#link-to 'other'}}other route{{/link-to}}
<br>
<br>
{{outlet}}
<br>
<br>
<h3>Other route</h3>
<h3>JSON Editor</h3>
{{json-editor json=fields mode='code' class="json-editor-fix"}}
{
"version": "0.10.1",
"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.6.0",
"ember-data": "2.6.1",
"ember-template-compiler": "2.6.0"
},
"addons": {
"ember-jsoneditor": "0.1.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment