gs-web-component
v1.0.0
Published
Modal like web component
Downloads
5
Readme
GM-WEB-COMPONENT
#Using gm-web-component my-array -> acceps array of objects with title,img,destination show-modal -> true or false to display modal background-color -> background of modal text-color -> color of text
angular usage add CUSTOM_ELEMENTS_SCHEMA to your app.module.ts import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; schemas: [CUSTOM_ELEMENTS_SCHEMA]
add defineCustomElements to main.ts
import { defineCustomElements } from "gm-web-component/loader"
defineCustomElements(window);
******* Add this to every module where you use component *********
react usage add applyPolyfills, defineCustomElements to your index.js import { applyPolyfills, defineCustomElements } from "gm-web-component/loader"; in you component where you use gm-web-component add import "gm-web-component";
extra note Binding in react works fine for array..you need to convert it to json
extra note Binding in angular is a little bit tricky..you will have to add array with setAttribute('items',JSON.stringify(arrayForConverting))