SHARE
TWEET

Untitled

a guest Jun 16th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="row" ng-controller="stuffsController">
  2.     <div class="col-md-12">
  3.         <button type="button" class="btn btn-success" ng-click="editCheckboxes()">Edit!</button>
  4.     </div>
  5.     <div class="col-md-6">
  6.         <input type="checkbox" ng-true-value="':reportview:'" ng-model="formData.permits.report.view" ng-checked="checkPermits('reportview')"/>
  7.         <input type="checkbox" ng-true-value="':reportedit:'" ng-model="formData.permits.report.edit" ng-checked="checkPermits('reportedit')"/>
  8.         <input type="checkbox" ng-true-value="':reportdelete:'" ng-model="formData.permits.report.delete" ng-checked="checkPermits('reportdelete')"/>
  9.     </div>
  10. </div>
  11.      
  12. app.controller('stuffsController', function ($scope, $http) {
  13. $scope.checkPermits = function (permits_str, clue){
  14.     //permits_str = ':reportview::reportedit:';
  15.     if (permits_str.includes(clue)){
  16.         return true;
  17.     }
  18. };
  19. $scope.editCheckboxes = function () {
  20.     //I want the checkPermits() execute in here...
  21. }});
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top