Class: Label

TrelloEntities.Label(data)

The Label class represents a Label in Trello.

You will mostly deal with this in an IterableCollection returned from methods in Card and Board.

Constructor

new Label(data)

Parameters:
Name Type Description
data

(Object} key/value pairs of information, must at least contain "id", can basically just pass in response from Trello API

Source:
Example
new Trellinator().board().labels().each(function(label)
{
    card.addLabel(label.name());
});

Methods

(static) this.card()

Return the card that this label is on if any (usually returns null unless this label was returned from a Notification where a label was added to a card, or from a card.label() method)

Source:
Example
new Notification(posted).addedLabel()
                        .card()
                        .postComment("Hi there!");

(static) this.id()

Return the id of this Label

Source:
Example
card.label("Something").id();

(static) this.name()

Return the name of this Label

Source:
Example
card.labels().first().name();

(static) this.setContainingCard()

Set the containing card that will be returned from the card() method

Source: