Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<html ng-app="app">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-controller="MyCtrl">
    Width : <input type="number" min="1" data-ng-model="widthLength" ng-change="init()" /></br>
    height : <input type="number" min="1" data-ng-model="heightLength" ng-change="init()" /></br>
    <image ng-src="{{imageUrl}}" />
</body>
</html>
<script>
    var app = angular.module( 'app', [] );
    app.controller('MyCtrl', function($scope, $http){      
        $scope.widthLength = 1024;
        $scope.heightLength = 768;
        $scope.init = function() {
            if($scope.widthLength !== null && $scope.heightLength !== null &&
                $scope.widthLength !== undefined && $scope.heightLength !== undefined) {
                $scope.imageUrl = "http://lorempixel.com/" + $scope.widthLength + "/" + $scope.heightLength + "/";
            } else {
                alert("please type");
            }
        };
        $scope.init();
    });
</script>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
Jacksonnnnnnnnnnnnpro
0viewers