Conditional button enable

by Aides

HTML

<div ng-app="app">
  <div ng-controller="testCtrl as test">
    <div ng-repeat="day in test.days">
      {{$index}}
      <input type="checkbox" ng-model="day.enabled">
      <button ng-disabled="!day.enabled" ng-click="this.click()">
        Add time block
      </button>
    </div>
    {{test.days}}
  </div>
</div>

JavaScript

angular.module('app', [])
  .controller('testCtrl', ['$scope', function($scope) {
  	var self = this;
    
    this.days = [];
    for(var i = 0; i < 7; i++)
    {
      this.days.push({ enabled: false, timing: {} });
    }
    
             
    this.click = function()
    {
    }
  }]);