@hmcts/ccpay-payments-list
v1.1.0
Published
A web component for services to display payments returned from ccpay into a html table
Downloads
7
Maintainers
Keywords
Readme
ccpay-payments-list
HTML5 Web component to display lists of payments
How to install
Node.js / Angular
- RUN
npm i @hmcts/ccpay-payments-list
OR ADD this dependency "@hmcts/ccpay-payments-list": "^1.0.0" to package.json - modify your build process so it copies the following files to a location where they are be visible on the browswer:
- payments.js
- imports/webcomponents-bundle.js
- imports/json2html.js
Check the example on the demo folder
Vanilla
Download and copy the following files into your project:
- payments.js
- imports/webcomponents-bundle.js
- imports/json2html.js
Check the example on the demo folder
How to use
- Import the 3 scripts from the locations they are visible. Example:
<script src="../imports/webcomponents-bundle.js">
</script>
<script src="../imports/json2html.js">
</script>
<script src="../payments.js" defer>
</script>
- Declare the template
<template id="payments-list"></template>
- Place the component where you want to be rendered
<payments-list data='jsonDataAsItComesFromTheService'></payments-list>
In the data attribute pass the body response received from the payments by case endpoint