javascript - Can't stay on same page/route after closing modal window in Angular JS on iPad -
here issue. i'm using angular js + phonegap ipad app , i'm trying stay in same route when on page after closing modal window video embedded in it.
the problem had video not stop playing after closing modal window, added ontouchstart
event closewindow()
so:
<div class="modal-youtube" ng-class="{visible: modalactive}"> <a class="close" href="#/mypage/#" eat-click ng-click="closevideo()" ontouchstart="closevideo()"></a> <iframe width="560" height="315" ng-show="youtubelink" ng-src="{{youtubelink}}" frameborder="0" allowfullscreen></iframe> </div>
this works stopping video when closing, however, when closing video wants go home page. changed href="#"
href="#/mypage/#
in order @ least stay on page want be, not in same route.
for example, have few different videos on separate routes or urls like: #/mypage/product1, #/mypage/product3, #/mypage/product6
here's functions playing , closing video:
$scope.youtubelink = null; $scope.modalactive = false; $scope.playvideo = function() { $scope.youtubelink = angular.copy($scope.product.youtube); $scope.modalactive = true; }; $scope.closevideo = function() { $scope.youtubelink = null; $scope.modalactive = false; };
any fix or appreciated!
Comments
Post a Comment