Hi all,

I hope someone can help me. I'm trying to reproduce the same angular
inputs: http://plnkr.co/edit/c8Y8Muu3ypdZPpdj5WM9?p=preview

There is an issue somewhere because what is defined in the controller it's
not working in the view. I'm using the latest commit from the master branch.

You may see the code below and I've attached the results.

Thanks in advance.

Tamas

%angular
<script>
angular.module('ui.bootstrap.demo', ['ngAnimate', 'ui.bootstrap']);
angular.module('ui.bootstrap.demo').controller('ButtonsCtrl', function
($scope) {
  $scope.singleModel = 1;

  $scope.radioModel = 'Middle';

  $scope.checkModel = {
    left: false,
    middle: true,
    right: false
  };

  $scope.checkResults = [];

  $scope.$watchCollection('checkModel', function () {
    $scope.checkResults = [];
    angular.forEach($scope.checkModel, function (value, key) {
      if (value) {
        $scope.checkResults.push(key);
      }
    });
  });
});
</script>
<div ng-controller="ButtonsCtrl">
    <h4>Single toggle</h4>
    <pre>{{singleModel}}</pre>
    <button type="button" class="btn btn-primary" ng-model="singleModel"
btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
        Single Toggle
    </button>
    <h4>Checkbox</h4>
    <pre>Model: {{checkModel}}</pre>
    <pre>Results: {{checkResults}}</pre>
    <div class="btn-group">
        <label class="btn btn-primary" ng-model="checkModel.left"
btn-checkbox>Left</label>
        <label class="btn btn-primary" ng-model="checkModel.middle"
btn-checkbox>Middle</label>
        <label class="btn btn-primary" ng-model="checkModel.right"
btn-checkbox>Right</label>
    </div>
    <h4>Radio &amp; Uncheckable Radio</h4>
    <pre>{{radioModel || 'null'}}</pre>
    <div class="btn-group">
        <label class="btn btn-primary" ng-model="radioModel"
btn-radio="'Left'">Left</label>
        <label class="btn btn-primary" ng-model="radioModel"
btn-radio="'Middle'">Middle</label>
        <label class="btn btn-primary" ng-model="radioModel"
btn-radio="'Right'">Right</label>
    </div>
    <div class="btn-group">
        <label class="btn btn-success" ng-model="radioModel"
btn-radio="'Left'" uncheckable>Left</label>
        <label class="btn btn-success" ng-model="radioModel"
btn-radio="'Middle'" uncheckable>Middle</label>
        <label class="btn btn-success" ng-model="radioModel"
btn-radio="'Right'" uncheckable>Right</label>
    </div>
</div>

Reply via email to