Skip to content

Instantly share code, notes, and snippets.

@gobijan
Last active June 30, 2016 14:05
Show Gist options
  • Save gobijan/9bfdccc0b3f7d50b841273049ecc0b90 to your computer and use it in GitHub Desktop.
Save gobijan/9bfdccc0b3f7d50b841273049ecc0b90 to your computer and use it in GitHub Desktop.
Guides Playground
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('about');
this.route('posts', function(){
this.route('new');
});
this.route('post', { path: '/post/:post_id'});
this.route('page-not-found', { path: '/*wildcard' });
});
export default Router;
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.active {
color: orange;
}
h1 .active{
color: black;
}
<h1>{{#link-to "application"}}Welcome to {{appName}}{{/link-to}}</h1>
<nav>
{{#link-to "posts"}}Posts{{/link-to}} |
{{#link-to "about"}}About{{/link-to}}
</nav>
<main>
{{outlet}}
</main>
<h2>Post with ID: </h2>
<h2>Posts</h2>
<nav>
{{#link-to "posts.new"}}New{{/link-to}}
</nav>
{{outlet}}
{
"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": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment