Class: exports

exports(dataObjectopt, optionsopt)

ImageCardComponent is a CardComponent extension that shows a single image and metadata. It shows the image along with an optional title and caption from the `CardComponent`.

Constructor

new exports(dataObjectopt, optionsopt)

Parameters:
Name Type Attributes Default Description
dataObject DataModel <optional>
null
options Object <optional>
Properties
Name Type Attributes Default Description
image string <optional>
null a URL to an image
dataField string <optional>
null the field name in the DataObject that holds the URL to an image
title string <optional>
null a string to use as a title
titleField string <optional>
the field name in the DataObject that holds the title of the image
captionField string <optional>
the field name in the dataObject that holds the caption
Source:
Example

Use a DataModel to drive the image card.

const model = new DataModel({
	image: '//static/image.png',
	name: 'Great Image',
	description: 'You will love it'
})

const imageCardComponent = new ImageCardComponent(model, {
	dataField: 'image',
	titleField: 'name',
	captionField: 'description'
})

exports()

MockService attaches itself to DataObject and will service fetches if it has a matching endpoint, otherwise it uses window.fetch.

Constructor

new exports()

Source:
Example
let service = new MockService()
service.addEndpoint(/^blog\/([0-9a-z]+)$/, (...params) => {
	var debug = {hello: "world"}
	let blob = new Blob([JSON.stringify(debug, null, 2)], {type : 'application/json'});
	return new Response(blob, { "status" : 200 , "statusText" : "OK" })
})
service.attachToDataObject()