Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Data */
- var gameData = angular.module('gameData', ['ngResource']);
- gameData.factory('gameData', ['gameService',function(gameService){
- // I got here the error.
- var slipCart = new slipCart("gameslip-cart");
- var events = gameService.getGroupedEvents()
- .success(function(data) {
- return data.sportEvents;
- });
- // Initalize types.
- var slipTypes = [
- ];
- return {
- events : events,
- slipCart: slipCart,
- slipTypes: slipTypes
- };
- }]);
- // Item
- function cartItem(id, name, odds, result){
- this.id = id;
- this.name = name;
- this.odds = odds;
- this.result = result;
- }
- // Slip cart
- function slipCart(cartName) {
- this.cartName = cartName;
- this.slipPrice = 200;
- this.slipType = 1;
- this.items = [];
- var self = this;
- }
- slipCart.prototype.getPrice = function() {
- return this.slipPrice;
- }
- slipCart.prototype.getType = function() {
- return this.slipType;
- }
- slipCart.prototype.getOdds = function() {
- // Implementation
- }
- slipCart.prototype.saveItems = function() {}
- slipCart.prototype.addItem = function(id, name, odds, result) {
- // Implementation
- }
- slipCart.prototype.removeItem = function(index) {
- // Implementation
- }
- slipCart.prototype.clearItems = function() {
- // Implementation
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement