wire.Collection

A collection is a basic programming structure that allows an array of objects to be maintained using a field as a unique key.

The following creates a new Collection object from users using the UserName field as the key. The first parameter to the constructor is the key field and the second is the array of objects.

let users = [
    { UserName: "apeters", FullName: "Amy Peters" },
    { UserName: "pdougherty", FullName: "Pat Dougherty" },
    { UserName: "tleach", FullName: "Tim Leach" }
];

let collection = new wire.Collection("UserName", users);

Use the following methods to maintain a collection of users.

Methods

For more examples on using WireBootstrap collections, visit Collections.

Last updated