I have a large array that looks something like this:
$scope.providers = [{
providerName: 'John Doe',
colors: 1,
itemQuantity: 100,
item: 'pen',
price: 2.5
},
{
providerName: 'John Doe',
colors: 1,
itemQuantity: 200,
item: 'pen',
price: 2
},
providerName: 'John Doe',
colors: 3,
itemQuantity: 400,
item: 'clock',
price: 10
},
providerName: 'Jane Doe',
colors: 1,
itemQuantity: 50,
item: 'bag',
price: 15
}]
I am working on creating a proposal generator, where our employees need to choose which provider option they want to use. These providers simply put logos on our products, and the array of objects contains the prices based on colors, item type, and quantity.
My goal is to create a select input to choose the provider (let's say John Doe), followed by selecting the color quantity options only offered by John Doe. Then, another input for choosing the item type that John Doe works with for that color quantity, and so forth. Finally, I aim to calculate the total price for the selected options.
I am struggling to figure out how to implement this in AngularJS (version 1.5.8).
Furthermore, I believe there is a better way to organize my data than the current massive array.
Any suggestions on addressing these challenges would be greatly appreciated!
Thank you!