Skip to content

Instantly share code, notes, and snippets.

@smolnar
Last active May 18, 2017 10:07
Show Gist options
  • Save smolnar/5ec03dd58230c2cf3fda6737d77f819b to your computer and use it in GitHub Desktop.
Save smolnar/5ec03dd58230c2cf3fda6737d77f819b to your computer and use it in GitHub Desktop.
Ember Route Action
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
message(message) {
console.log(message);
}
}
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{first-level-component}}
{{outlet}}
<br>
<br>
First Level Component &middot; <a href="#" {{action (route-action 'message' 'First')}}>Click</a>
{{second-level-component}}
Second Level Component &middot; <a href="#" {{route-action 'message' 'Second'}}>Click</a>
{
"version": "0.12.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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1",
"ember-route-action-helper": "2.0.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment