Edit on
<div class="container" ng-app="dApp" ng-controller="dctrl">
<div class="col-sm-8 col-sm-offset-2">
  <div class="page-header"><h1>dynamically add Classes in angularjs</h1></div>
    <div class="form-group">
        <label>Button class name (enter some bootstrap classes name like : danger, success, warning etc.)</label>
        <input type="text" ng-model="btnClass" class="form-control">
    </div>
        <button type="button" class="btn btn-{{btnClass}}">Default</button>
  </div>
</div>
var app = angular.module('dApp', []);
app.controller('dctrl', function($scope){
  $scope.btnClass = "danger";
});
Rerun