i have a link with ui-sref attribute and also a jQuery touch event, but the problem is that when i click on this element the jQuery handler is running but the ui-sref not.
Jquery:
$('#fa-bar, #mobile-nav li').on('touchstart', function( e ) {
e.stopPropagation();
$('#mobile-nav').toggleClass('toggle-mobile-nav');
$('#mobile-nav').toggleClass('prevent-scroll');
});
Html:
<li ui-sref="state" ui-sref-active="nav-active"><a>Link</a></li>
See the docs and this example:
However, stopEvent also calls an event object method, event.stopPropagation, which keeps the event from bubbling any further up into the DOM. Note that the table itself has an onclick event handler that ought to display a message when the table is clicked. But the stopEvent method has stopped propagation, and so after the data in the table is updated, the event phase is effectively ended, and an alert box is displayed to confirm this.
This is pure javascript and also applies for AngularJS. Your call to e.stopPropagation()
prevents ui-router from getting the event. This is sometimes handy if you want to add an URL to something (so you can still use open-in-new-tab feature of your browser), but want a different behavior on normal clicks.
I am new to Angular and have a situation where I must pass in an object into an attribute of an element inside an ng-repeat. The code works fine when returning the new object if I do not use ajax to ...
I am new to Angular and have a situation where I must pass in an object into an attribute of an element inside an ng-repeat. The code works fine when returning the new object if I do not use ajax to ...
i am new in Phonegap development. In my current project, i want to get user profile name, gmail and email address. I know how to retrieve these information in native Android. By using which plugin, i ...
i am new in Phonegap development. In my current project, i want to get user profile name, gmail and email address. I know how to retrieve these information in native Android. By using which plugin, i ...
I'm trying to create a gulpfile that lint my personal javascript files (.js) but ignore any vendor/third party libaries. My gulp file is listed below: var gulp = require("gulp"), uglify = ...
I'm trying to create a gulpfile that lint my personal javascript files (.js) but ignore any vendor/third party libaries. My gulp file is listed below: var gulp = require("gulp"), uglify = ...
I am trying to display data from database in angularjs using webservice But geting Error[object Object] while retriving data My web method is: <WebMethod()> _ <ScriptMethod(ResponseFormat:=...
I am trying to display data from database in angularjs using webservice But geting Error[object Object] while retriving data My web method is: <WebMethod()> _ <ScriptMethod(ResponseFormat:=...