Skip to content

Instantly share code, notes, and snippets.

@trmcnvn
Created September 26, 2015 02:39
Show Gist options
  • Save trmcnvn/e19ef7d2e125ae9a75b0 to your computer and use it in GitHub Desktop.
Save trmcnvn/e19ef7d2e125ae9a75b0 to your computer and use it in GitHub Desktop.
Routable Components
import Ember from 'ember';
const { Component } = Ember;
export default Component.extend({
isGlimmerComponent: true,
text: 'Hello, World!'
});
import Ember from 'ember';
export default Ember.Route.extend({
// required to connect the route and component
templateName: 'undefined'
});
<h1>Text: {{text}}</h1>
import Ember from 'ember';
import config from './config/environment';
Ember.FEATURES['ember-routing-routable-components'] = true;
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.route('home', { path: '/' });
});
export default Router;
{
"version": "0.4.10",
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "http://builds.emberjs.com/canary/ember.debug.js",
"ember-template-compiler": "http://builds.emberjs.com/canary/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment