Coder Social home page Coder Social logo

remackgeek / elements-zone-strategy Goto Github PK

View Code? Open in Web Editor NEW
35.0 3.0 3.0 3.26 MB

A custom NgElementStrategyFactory to enable zone-based change detection for Angular Elements

License: MIT License

JavaScript 11.17% TypeScript 76.71% HTML 10.44% CSS 1.34% SCSS 0.33%

elements-zone-strategy's Introduction

elements-zone-strategy

This library provides an Angular Elements Strategy Factory which always runs in the NgZone, allowing automatic change detection

license downloads

This library is no longer needed for Angular versions 10.1 and above!

see: here

This addresses the following issues with @angular/elements:

Usage

install the package:

npm install --save elements-zone-strategy

use the new strategy:

import { ElementZoneStrategyFactory } from 'elements-zone-strategy';

const strategyFactory = new ElementZoneStrategyFactory(HelloComponent, this.injector);
const helloElement = createCustomElement(HelloComponent, { injector: this.injector, strategyFactory });
customElements.define('my-hello', helloElement);

Versions

Not needed in Angular 11

use version 10.0.0 for Angular 10 (not needed as of 10.1)

use version 9.0.0 for Angular 9

use version 8.0.0 for Angular 6-8

elements-zone-strategy's People

Contributors

remackgeek avatar dependabot[bot] avatar tnicola avatar

Stargazers

YGZX avatar Junxiang Wei avatar  avatar Julian David avatar Arjun Suresh avatar Ravi Teja Deevi avatar David Boclé avatar Chase Spencer avatar Vinayak Patil avatar  avatar José G. Ramírez avatar  avatar  avatar  avatar  avatar  avatar Neil Xie avatar Alicia F Rodriguez avatar Robert Smith avatar Denis Bendrikov avatar Mike Huang avatar  avatar  avatar Dmitriy Kazinov avatar Rober Morales-Chaparro avatar Tomasz Maruszak avatar Julián avatar Dirk avatar Maksim Popov avatar Dmitry Gorelenkov avatar Samuel Documet Ferroni avatar  avatar Frank avatar Anoop Nair avatar Steph Meslin-Weber avatar

Watchers

Arjun Suresh avatar Julián avatar Moulaye Abderrahmane ELI MBITALEB avatar

elements-zone-strategy's Issues

Angular 11 Support

I'm filing this issue to help us determine whether there are changes needed to support Angular 11, or whether we can just bump the peer dependency to include Angular 11.

DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry

Hi,

First of all thanks! This module made my change detection work which was the thing that was putting me off using Angular Elements.

I have noticed that using this causes the above error to reappear when I try to load a second Angular Element (I only use one at a time but I need to be able to switch them).

I had this problem before but I hacked my way around it by messing with webpackJsonP. When I use your module, this no longer works and I can't really work out why it has this effect.

Do you have any ideas what might be causing that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.