Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-app="app">
  <div ng-controller="firstCtrl">
    <h1 ng-class="bg.type">{{bg.type}}</h1>
    
    <button ng-click="gah('new-class')">change class</button>
      </div>
</body>
</html>
 
.new-class{
  color:red;
}
.witzle-bg-image{
  color:green;
}
 
var app = angular.module('app', []);
app.controller('firstCtrl', function($scope){
$scope.bg = {type:'witzle-bg-image'};
$scope.gah = function(name){
     // alert(name)
      $scope.bg = {type:name};
 };
});
Output

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

Dismiss x
public
Bin info
zieemerpro
0viewers