Grape.TagContainer Class
A container for tagging. You can get items by tags.
Constructor
Grape.TagContainer
()
Item Index
Methods
Methods
createResultContainer
()
Array
Creates an array-like object. If you want to redefine the result type of the get method, you can override this method.
Returns:
Array:
An initial array.
get
(
Array
-
tag
Gets items stored in the container by a tag.
Parameters:
-
tag
StringThe tag
Returns:
Array:
Items containing the tag
Example:
var container = new Grape.TagContainer();
var obj = new Grape.Taggable();
obj.setTagContainer(container);
obj.addTag('my tag');
container.get('my tag'); //returns an array containing obj