new Tags()
Manage Tags inside FORGE.
Tags is singleton, so if you have multiple instances in the same page you MUST avoid Tags conflict.
- Source:
Extends
Members
(readonly) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- Source:
(readonly) className :string
Get the class name of the object.
Type:
- string
- Inherited From:
- Source:
data :*
Get and set any custom data you want to associate to this object.
Type:
- *
- Inherited From:
- Source:
debug :boolean
Get and set the debug flag.
Type:
- boolean
- Inherited From:
- Source:
(readonly) onDestroy :FORGE.EventDispatcher
Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
- Inherited From:
- Source:
(readonly) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- Source:
Methods
(static) exists(tag) → {boolean}
Does a tag exists ?
Parameters:
Name | Type | Description |
---|---|---|
tag |
string | The tag you want to check. |
- Source:
Returns:
Returns true if uid is already registered, false if not.
- Type
- boolean
(static) get(value, className) → {Object|Array|undefined}
Get objects associated to a tag or to an array of tags.
You can filter the className of objets to get.
You can filter the className of objets to get.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Array | The uid or array of uids of object(s) you want to get. |
className |
string | Filter you result by className of objects. |
- Source:
Returns:
Returns an object or an array of objects that matches the request.
- Type
- Object | Array | undefined
(static) getUids(value, className) → {Array.<string>}
Get uids associated to a tag or to an array of tags.
You can filter the className of objets to get.
You can filter the className of objets to get.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Array | The uid or array of uids of object(s) you want to get. |
className |
string | Filter you result by className of objects. |
- Source:
Returns:
Returns an array of uids that matches the request.
- Type
- Array.<string>
(static) hasTypeOf(tag, className) → {boolean}
Tell if this tag have at least an object of a specific className.
Parameters:
Name | Type | Description |
---|---|---|
tag |
string | The tag you want to check if it reference an onbject of specified className. |
className |
string | The className you want to check. |
- Source:
Returns:
Returns true if the tag have at least an object of the asked className.
- Type
- boolean
(static) register(object)
Register a tagged object.
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | The object you want to register into the tag index. |
- Source:
destroy()
Basic destroy method, prevent double destroy, change the alive flag.
- Inherited From:
- Source:
log(value)
Basic log method, log a string in the console if debug is enabled.
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value you want to log in the console. |
- Inherited From:
- Source:
warn(valuenullable)
Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | Object |
<nullable> |
The value you want to warn in the console. |
- Inherited From:
- Source: