Skip to content

Instantly share code, notes, and snippets.

@brianshano
Created September 6, 2016 14:39
Show Gist options
  • Select an option

  • Save brianshano/a1f5d07f9f89a92ec39f61c38573ca84 to your computer and use it in GitHub Desktop.

Select an option

Save brianshano/a1f5d07f9f89a92ec39f61c38573ca84 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';
export default Ember.Controller.extend({
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('artists', { path: '/artists/:letter_id', });
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
console.log('in the artists route ' + params.letter_id);
return this.set('letterId', params.letter_id);
}
});
<h1>Welcome to {{appName}}</h1>
<br>{{#link-to "index" }}home{{/link-to}}
<br>
{{#link-to "artists" "a" }}artists beginning with a{{/link-to}}<br>
{{#link-to "artists" "b" }}artists beginning with b{{/link-to}}<br>
{{#link-to "artists" "c" }}artists beginning with c{{/link-to}}{{outlet}}
<br>
<br>
<h1>artists page</h1>
<div>selected letter = {{letterId}}</div>
{
"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