While working on this template, I encountered issues with the functionality after integrating Angular into the application. Although I managed to fix most of them, I'm facing difficulty getting the slideshow to function properly.
Here is the HTML code:
<!doctype html>
<!--[if IE 9 ]><html class="ie9" lang="en"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en"><!--<![endif]-->
<head>
<link rel="icon" type="image/ico" href="images/fav.ico">
<!--stylesheet include-->
<link rel="stylesheet" type="text/css" media="all" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="all" href="css/camera.css">
<link rel="stylesheet" type="text/css" media="all" href="css/owl.carousel.css">
<link rel="stylesheet" type="text/css" media="all" href="css/owl.transitions.css">
<link rel="stylesheet" type="text/css" media="all" href="css/jquery.custom-scrollbar.css">
<link rel="stylesheet" type="text/css" media="all" href="css/style.css">
<link rel="stylesheet" type="text/css" media="all" href="css/lightbox.css">
<!--font include-->
<link href="css/font-awesome.min.css" rel="stylesheet">
</head>
<body ng-app="app">
<div class="camera_wrap m_bottom_0" ng-controller="slideShowCtrl" ng-show="slideShow()">
...
</div>
<div ng-view></div>
<script src="js/jquery-2.1.4.js"></script>
...
<script src="app/filters.js"></script>
</body>
</html>
This is the controller I am using:
controllers.slideShowCtrl = function($scope, $location){
$scope.slideShow = function(){
if($location.url() == '/' || $location.url() == '/home'){
$scope.slideShowView = true;
return true;
}else{
$scope.slideShowView = false;
return false;
}
}
}
Below is the jQuery code for creating the slideshow:
// camera slideshow
(function(){
var cs = $('.camera_wrap');
if(cs.length){
...
}
})();
The issue arises when I navigate through the pages and return to the home page (#/home) – sometimes the slider breaks, sometimes it doesn't, and occasionally it fixes itself. Here are screenshots illustrating the problem: https://i.sstatic.net/OYzmf.png and https://i.sstatic.net/P949p.png.
If more code snippets are required for better understanding, please let me know. Thank you for your assistance.