Skip to content

Instantly share code, notes, and snippets.

@ryanto
Created September 14, 2018 04:47
Show Gist options
  • Save ryanto/645087c338bad781590ad2732e93baae to your computer and use it in GitHub Desktop.
Save ryanto/645087c338bad781590ad2732e93baae to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('page', { path: '/*path' });
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
return params.path;
}
});
<h1>Welcome to {{appName}}</h1>
{{link-to "visit /hello-world" "page" "hello-world"}}
<br>
<br>
{{link-to "visit /hello/world" "page" "hello/world"}}
<br>
<br>
{{link-to "visit /a/b/c/d/" "page" "a/b/c/d"}}
<br>
<br>
{{outlet}}
<br>
<br>
You're on the {{model}} page.
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment