Angular JS
/** * Created by HOME on 4/18/2016. */
var app=angular.module('myapp',[]);
var no=0;var ur=0;var image=["oo1.jpg","oo2.jpg"];
app.controller('mycontroller',function($scope){
$scope.loadnext=function(){
ur=no++;
if(image.length <= ur){
$scope.clickup="No more Images "; }else { console.log("you clicked a button"); $scope.clickup = "You Clicked "+ ur +" Times "; $scope.clickup2 = "You pulled " + ur + "-><img src= height='40px' width='25px'> "; $scope.clickup3 = image[ur]; }
}
$scope.loadprev=function(){
ur=no--;
if( ur <= 0){
$scope.clickup="No more Images "; }else { console.log( "You Clicked "+ ur +" Times "); $scope.clickup = "You Clicked "+ ur +" Times"; $scope.clickup2 = "You pulled " + ur + "-><img src= height='40px' width='25px'> "; $scope.clickup3 = image[ur]; }
}
});
No comments:
Post a Comment