Skip to content

Instantly share code, notes, and snippets.

@LevelbossMike
Created June 1, 2016 11:59
Show Gist options
  • Select an option

  • Save LevelbossMike/4311ca98a1fd2932421ba462f1c0a7ca to your computer and use it in GitHub Desktop.

Select an option

Save LevelbossMike/4311ca98a1fd2932421ba462f1c0a7ca 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';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none'
});
Router.map(function() {
this.route('dashboard', function() {
this.route('no');
this.route('yes');
})
});
export default Router;
import Ember from 'ember';
import ProtectedRoute from '../protected';
export default ProtectedRoute.extend({
});
import Ember from 'ember';
export default Ember.Route.extend({
beforeModel(transition) {
alert('protected routes cannot be entered');
transition.abort();
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{#link-to 'dashboard.yes'}}Yes{{/link-to}}
{{#link-to 'dashboard.no'}}No{{/link-to}}
<br>
<br>
You can't see this
{{#link-to 'index'}}Index{{/link-to}}
Yes we can
{{#link-to 'index'}}Index{{/link-to}}
{
"version": "0.8.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.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment