0

Hi I am developing a car park reservation system, I have an array of objects that look like this

    $scope.availability = [
        {
            date: "Mon, 20 June 2014",
            spaces: [
                1,
                ...,
                X
            ]
        },
        {
            date: "Mon, 21 June 2014",
            spaces: [
                1,
                ...,
                X
            ]
        },
        {
            date: "Mon, 22 June 2014",
            spaces: [
                1,
                ...,
                X
            ]
        },
        {
            date: "Mon, 23 June 2014",
            spaces: [
                1,
                ...,
                X
            ]
        }
    ];

The user can select to reserve upto 10 spaces (these can be hard coded) on multiple dates.

I have a similar array in which to save selected dates and number of spaces called

$scope.selectedDates = [
    {
        date: null,
        spaces: null
    }
]

I want to be able to have the user populate data and spaces based on what they select. selectedDates has an extra object added to it, when ever a user clicks a button (this works) what is the best way to go about doing this with angular?

DrogoNevets
  • 1,456
  • 3
  • 18
  • 34

0 Answers0