Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<script src="http://code.angularjs.org/1.2.14/angular-sanitize.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-controller="mainController">
  
  <h3>A Demo to Dynamically Add/Remove Javascript with AngularJS</h3>
  <button ng-click="script = one">One</button>
  <button ng-click="script = two">Two</button>
  <button ng-click="script = three">Three</button>
  
  <script ng-bind-html="script"></script>
 
  
  <script>
      var app = angular.module('app', ['ngSanitize']);
      app.controller('mainController', function($scope){
        $scope.one = "setInterval(function(){ $('body').append('One'); }, 500);";
        $scope.two = "setInterval(function(){ $('body').append('Two'); }, 500);";
        $scope.three = "setInterval(function(){ $('body').append('Three'); }, 500);";
        $scope.script = '';
      });
  </script>
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
matthoilandpro
0viewers