Skip to content

Instantly share code, notes, and snippets.

@GavinJoyce
Created February 23, 2017 14:35
Show Gist options
  • Select an option

  • Save GavinJoyce/e4fbf33d13257c15a86a0072f28fbb40 to your computer and use it in GitHub Desktop.

Select an option

Save GavinJoyce/e4fbf33d13257c15a86a0072f28fbb40 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
showLink: true
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('user', { path: '/user/:user_id' });
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
return {
id: params
};
}
});
{{input type="checkbox" checked=showLink}} ({{showLink}})
{{#conditional-link-to "index" showLink=false}}
Intercom
{{/conditional-link-to}}
{{#conditional-link-to "index" showLink=showLink}}
Intercom
{{/conditional-link-to}}
{{#conditional-link-to "user" 142857 showLink=false}}
User 142857
{{/conditional-link-to}}
{{#conditional-link-to "user" 142857 showLink=showLink}}
User 142857
{{/conditional-link-to}}
<hr />
{
"version": "0.11.0",
"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.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {
"ember-href-to": "1.11.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment