Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229528

Scope lost on app resume (?)

$
0
0

I found the cause of the problem but don't yet understand why this has happened.

In the following function there is no scope.$apply() function. It's executing an angular.noop().

`.factory('$ionicNgClick', ['$parse', function($parse) {
return function(scope, element, clickExpr) {
var clickHandler = angular.isFunction(clickExpr) ?
clickExpr :
$parse(clickExpr);

       element.on('click', function(event) {
            **scope.$apply(function()** {
                clickHandler(scope, {
                    $event: (event)
                });
            });
        });

        // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click
        // something else nearby.
        element.onclick = noop;
    };
}`

Viewing all articles
Browse latest Browse all 229528

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>