Closed xavicolomer closed 9 years ago
Hello,
event.stopPropagation()
works well for me with the last version (0.5.2):
router.get('test', function(req, ev) {
ev.stopPropagation();
});
router.get('*', function() {
alert('wrong');
});
May be your version or your pattern (MY.PATTERN).
Attention in your example router.get(*, ...
the wilcard must be a string router.get('*', ...
Hi there,
I am having some problems with Grapnel.
1 Listen is not working
I tried using this example but I couldn't make it work. https://github.com/EngineeringMode/Grapnel.js#declaring-multiple-routes
The only way I have to listen to url changes is using get: router.get(MY.PATTERN, function(req, event) { //do something });
2 I cannot event.stopPropagation inside get method
In order to restrict the user to only certain URLs I want to listen to any url change, if the url has a previous pattern match, it is correct, otherwise it is wrong. But I cannot find a way to stop the propagation.
router.get(MY.PATTERN, function(req, event) { event.stopPropagation() //not working. });
router.get(*, function(req, event) { alert('wrong url!'); });
Any ideas / suggestions?