Class: LinkComponent

LinkComponent(dataObjectopt, optionsopt)

LinkComponent displays an `a` element containing static text or text that is bound to a field in the dataObject. This class is meant to be used where you'd include an inline text link. See the Component.constructor's `option.anchor` parameter if you want click events on a Component's DOM element to trigger navigation.

Constructor

new LinkComponent(dataObjectopt, optionsopt)

Parameters:
Name Type Attributes Default Description
dataObject DataObject <optional>
null
options Object <optional>
{} See the TextComponent.constructor options, including dynamic text formatting.
Properties
Name Type Attributes Default Description
url string <optional>
'' The URL to which the link should anchor. This can conflict with the `options.anchor` passed to Component.constructor.
Source:
Examples

Use static text

const component = new LinkComponent(undefined, {
	text: 'Click me',
	url: '/some-other-page/'
})

Use bound text

const component = new LinkComponent(yourDataModel, {
	dataField: 'name',
	url: '#some-other-view'
})