Having a total of 12 cameras, I want to be able to select 4 cameras from a drop-down menu option and have only those 4 cameras displayed. Then, when I click on the next button, I need to show the remaining cameras in the selected layout format. How can this functionality be implemented?
<button class="butn" ng-click="previous_view()">Previous</button>
<button class="butn" id="next_button" ng-click="next_view()">Next</button>
<label class="head">Layout :</label>
<select class="layout_lst" ng-model="size" ng-change="setSize()">
<option ng-repeat="priority in sizeLst" value="{{priority.type}}">{{priority.name}} />
</select>
<div layout-wrap flex-wrap>
<iframe ng-repeat="item in camerasList | limitTo : size" ng-class="size" oncontextmenu="ShowContextMenu()" src={{item.url}} width="337" height="177" allow=loop />
</div>
</button>
//js code
$scope.sizeLst = [
{
"name": "2x2",
"type": "fourscreen"
}, {
"name": "3x2",
"type": "sixscreen"
}, {
"name": "4x2",
"type": "eightscreen"
}, {
"name": "3x3",
"type": "ninescreen"
}, {
"name": "3x4",
"type": "twelvescreen"
}
];
$scope.camerasList = [
{
"name": "camera 1",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "2screen"
}, {
"name": "camera 2",
"url": "assets/videoplayback.mp4",
"type": "2screen"
}, {
"name": "camera 3",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "4screen"
}, {
"name": "camera 4",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "4screen"
}, {
"name": "camera 5",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "6screen",
}, {
"name": "camera 6",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "6screen"
}, {
"name": "camera 7",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "8screen"
}, {
"name": "camera 8",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "8screen"
}, {
"name": "camera 9",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "8screen"
}, {
"name": "camera 10",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "8screen"
}, {
"name": "camera 11",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "8screen"
}, {
"name": "camera 12",
"url": "assets/Nature Beautiful short video 720p HD.mp4",
"type": "8screen"
}
let videoLst = $scope.camerasList;
console.log(videoLst);
$scope.setSize = () => {
// if ($scope.size == "1x2") {
// $scope.camerasList = videoLst.slice(0, 2);
// console.log($scope.camerasList)
// }
if ($scope.size === "fourscreen") {
$scope.camerasList = videoLst.slice(0, 4);
console.log($scope.camerasList)
}
if ($scope.size === "sixscreen") {
$scope.camerasList = videoLst.slice(0, 6);
console.log($scope.camerasList)
}
if ($scope.size === "eightscreen") {
$scope.camerasList = videoLst.slice(0, 8);
console.log($scope.camerasList)
}
if ($scope.size === "ninescreen") {
$scope.camerasList = videoLst.slice(0, 9);
console.log($scope.camerasList)
}
if ($scope.size === "twelvescreen") {
$scope.camerasList = videoLst.slice(0, 12);
console.log($scope.camerasList)
}
}
Clicking on the next button should display the next set of cameras from the array based on the selected layout. Can you assist with the code?