Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. /* Data */
  2.  
  3. var gameData = angular.module('gameData', ['ngResource']);
  4.  
  5. gameData.factory('gameData', ['gameService',function(gameService){
  6. // I got here the error.
  7. var slipCart = new slipCart("gameslip-cart");
  8.  
  9. var events = gameService.getGroupedEvents()
  10. .success(function(data) {
  11. return data.sportEvents;
  12. });
  13.  
  14. // Initalize types.
  15. var slipTypes = [
  16. ];
  17.  
  18. return {
  19. events : events,
  20. slipCart: slipCart,
  21. slipTypes: slipTypes
  22. };
  23. }]);
  24.  
  25. // Item
  26. function cartItem(id, name, odds, result){
  27. this.id = id;
  28. this.name = name;
  29. this.odds = odds;
  30. this.result = result;
  31. }
  32.  
  33. // Slip cart
  34. function slipCart(cartName) {
  35. this.cartName = cartName;
  36. this.slipPrice = 200;
  37. this.slipType = 1;
  38. this.items = [];
  39.  
  40. var self = this;
  41. }
  42.  
  43. slipCart.prototype.getPrice = function() {
  44. return this.slipPrice;
  45. }
  46.  
  47. slipCart.prototype.getType = function() {
  48. return this.slipType;
  49. }
  50.  
  51. slipCart.prototype.getOdds = function() {
  52. // Implementation
  53. }
  54.  
  55. slipCart.prototype.saveItems = function() {}
  56.  
  57. slipCart.prototype.addItem = function(id, name, odds, result) {
  58. // Implementation
  59. }
  60.  
  61. slipCart.prototype.removeItem = function(index) {
  62. // Implementation
  63. }
  64.  
  65. slipCart.prototype.clearItems = function() {
  66. // Implementation
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement