Create custom element in angular 6


Reading Time: 2 minutes 1) Create Angular Project ng new <project name> –prefix custom –style=scss –skip-tests 2) Use schematics to add angular element support ng add @angular/elements 3) Use angular-cli to generate new component and specify encapsulation is ViewEncapsulation.Native 4) REmove the document-create-element polyfill from script array. 5) Install custom-lements polyfill, “@webcomponents/custom-elements” yarn add @webcomponents/custom-elements 6) Update polyfills.ts to … Read more