Collections
WireBootstrap collections allow an array of objects to be managed using one of the attributes as a key.
Create a Collection
To create a collection, create a new instance of the wire.Collection
class passing in the key field that makes each row unique along with the array of data.
Add an Object
To add an object, use the set
method on the collection. This method will add the object to the collection if it does not already exist. If the object exists, it will be overwritten with the object that is passed into the method.
Retrieve an Object
To pull an object out of the collection, use the get
method with the key value.
Remove an Object
Use the remove
method with the key to remove an object from the collection.
Retrieve the Array
To pull the array out of the collection, use the array method.
For more on WireBootstrap collections, visit wire.Collection.
Last updated