Skip to content

Instantly share code, notes, and snippets.

@greyhwndz
Last active March 30, 2016 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greyhwndz/97fe5743aad1cdd9d118f827452647e0 to your computer and use it in GitHub Desktop.
Save greyhwndz/97fe5743aad1cdd9d118f827452647e0 to your computer and use it in GitHub Desktop.
Events - Stopping Event Propagation from an HTML a tag
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
stopPropagation(e) {
e.stopPropagation();
}
}
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none'
});
Router.map(function() {
this.route('route1');
});
export default Router;
{{#link-to 'route1' tagName="div"}}
To Route 1 <br>
<a href='http://google.com' target='_blank' onclick={{action 'stopPropagation'}}>I should open in a new tab to Google</a>
{{/link-to}}
{{outlet}}
{
"version": "0.7.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": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment