Guest User

Untitled

a guest
Nov 23rd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <tr ng-repeat="item in purchaseList.taskList | filter:purchaseList.name">
  2. <td class="text-center">
  3. <input type="checkbox" ng-model="item.id" />
  4. </td>
  5. <td class="text-center">{{$index+1}}</td>
  6. <td>{{item.name}}</td>
  7. <td class="text-center">{{item.b}}</td>
  8. <td class="text-center">{{item.c}}</td>
  9. <td class="text-center">{{item.d}}</td>
  10. <td class="text-center">{{item.e}}</td>
  11. <td class="text-center">{{item.f}}</td>
  12. <td class="text-center">{{item.g}}</td>
  13. <td class="text-center">{{item.h}}</td>
  14. <td class="text-center">{{item.credits}}</td>
  15. <td class="text-center">{{item.balance}}</td>
  16. <td width="5%" class="text-center config">
  17. <div class="buttons">
  18. <button type="button" class="btn btn-primary btn-xs">
  19. <span class="glyphicon glyphicon-pencil"></span>
  20. </button>
  21. <button class="btn btn-danger btn-xs" ng-click="purchaseList.delItem(item.id)">
  22. <span class="glyphicon glyphicon-trash"></span>
  23. </button>
  24. </div>
  25. </td>
  26. </tr>
  27.  
  28. angular.module('usersBaseApp', []).factory('db', databoomSrv("https://t813.databoom.space", "b813"))
  29. .controller('usersBaseController', function (db, $scope) {
  30.  
  31. var purchaseList = this;
  32.  
  33. purchaseList.addItem = function () {
  34. if (!purchaseList.name)
  35. return;
  36. db.save('userbase', {
  37. name: purchaseList.name,
  38. b: purchaseList.b,
  39. c: purchaseList.c,
  40. d: purchaseList.d,
  41. e: purchaseList.e,
  42. f: purchaseList.f,
  43. g: purchaseList.g,
  44. h: purchaseList.h,
  45. credits: purchaseList.credits,
  46. balance: purchaseList.balance
  47. })
  48. .then(function () {
  49. updateList();
  50. purchaseList.name = '';
  51. })
  52. };
  53.  
  54. });
Add Comment
Please, Sign In to add comment