generator-dmc-uicomp-materialcard
v1.0.3
Published
dmc reusable ui component
Downloads
1
Maintainers
Keywords
Readme
generator-dmc-uicomp-MaterialCard
Installation
First, install Yeoman and generator-dmcpodplugin using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-dmc-uicomp-MaterialCard
Then generate your new project:
yo dmc-uicomp-MaterialCard
How To Use the MaterialCard
- Include the Material Card XML View like below in your XML View
<mvc:XMLView viewName="<path to material card>.MaterialCard.MaterialCard" />
- Publish the event like below to load the material card details in your controller. along with data, it taken
success
anderror
call back functions.
let eventBus = this._getPodController().getOwnerComponent().getEventBus();
eventBus.publish("MaterialCard", "loadMaterialDetails", {
material:"yourMaterial", version:"yourMaterialVersion",
success:function(data){
/* data = {
material: "string",
description: "string",
version: "string",
image: "url",
additionalData:"array of Objects" //response of get material/v1/materials public api call
}
*/
console.log(data)
},
error:function(err){
console.log(err)
}
})