Skip to content

Instantly share code, notes, and snippets.

@dfreeman
Created September 30, 2016 14:57
Show Gist options
  • Save dfreeman/196d5d3690f726a45d56dba2c924b7f8 to your computer and use it in GitHub Desktop.
Save dfreeman/196d5d3690f726a45d56dba2c924b7f8 to your computer and use it in GitHub Desktop.
auth
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('app', { path: '' }, function() {
this.route('authenticated-route');
});
this.route('login');
});
export default Router;
Hello this is <code>app.authenticated-route</code>.<br>
Hello this is <code>app</code>.<br>
{{#link-to 'app'}}Home{{/link-to}}
{{#link-to 'app.authenticated-route'}}Authed Route{{/link-to}}
{{#link-to 'login'}}Log Out{{/link-to}}<br>
<div style="border: 1px solid #eee; padding: 1em">
{{outlet}}
</div>
Hello this is <code>app.index</code>.
Hello this is <code>application</code>.<br>
<div style="border: 1px solid #eee; padding: 1em">
{{outlet}}
</div>
Hello this is <code>login</code>.
{{#link-to 'app' tagName='button'}}
Log in
{{/link-to}}
{
"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