Skip to content

Instantly share code, notes, and snippets.

@mszoernyi
Created September 13, 2016 13:36
Show Gist options
  • Save mszoernyi/e49e8460eda03db7251e9ec9fef2fe7a to your computer and use it in GitHub Desktop.
Save mszoernyi/e49e8460eda03db7251e9ec9fef2fe7a to your computer and use it in GitHub Desktop.
New Twiddle
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('animals', { path: '/animals' }, function() {
this.route('one', { path: 'one' });
this.route('two', { path: 'two' });
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
});
Animals
<ul>
<li>{{#link-to 'animals.one'}}One{{/link-to}}</li>
<li>{{#link-to 'animals.two'}}Two{{/link-to}}</li>
</ul>
{{outlet}}
<h1>Welcome to {{appName}}</h1>
<br>
{{#link-to 'animals'}}Animals Page{{/link-to}}
<br>
{{outlet}}
<br>
<br>
{
"version": "0.10.5",
"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.8.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.8.0",
"ember-testing": "2.8.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment