Git Product home page Git Product logo

Comments (6)

adickson311 avatar adickson311 commented on May 23, 2024

Submitted a PR:
#18

from elements.

tomastrajan avatar tomastrajan commented on May 23, 2024

@adickson311 but is it ? the configs are registered in the service right ? so service holds them all, and whenever we call forFeature then we basically append the last one in the service or ?

 addConfigs(newConfigs: ElementConfig[]) {
    newConfigs.forEach(newConfig => {
      const existingConfig = this.getElementConfig(newConfig.tag);
      if (existingConfig) {
        console.warn(
          `${LOG_PREFIX} - ElementConfig for tag '${newConfig.tag}' was previously added, it will not be added multiple times, continue...`
        );
      } else {
        this.configs.push(newConfig);    // <--- this line 
      }
    });
  }

from elements.

tomastrajan avatar tomastrajan commented on May 23, 2024

@adickson311 because the constructors should happen one by one and NOT concurrently, that way we should also append configs to the service one by one and not lose anything ?

from elements.

tomastrajan avatar tomastrajan commented on May 23, 2024

@adickson311 the only way I could reproduce your bug is

@NgModule({
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  imports: [
    LazyElementsModule.forFeature(options1),
    LazyElementsModule.forFeature(options2),
  ]
})
export class ExampleModule {}

Where only the second option2 will be added, then again, does such an code make sense? It works great with single LazyElementsModule.forFeature(allFeatureOptions) registration...

The usage of last config prevents us from adding single config multiple times because then every new feature would re-add all the previous configs (because of the multi provider) and spam user with warning like this...

@angular-extensions/elements - ElementConfig for tag 'ion-button' was previously added, it will not be added multiple times, continue...

from elements.

tomastrajan avatar tomastrajan commented on May 23, 2024

@adickson311 do you have any other way to reproduce this behavior ?

from elements.

felipeplets avatar felipeplets commented on May 23, 2024

@adickson311 is this still an issue?

from elements.

Related Issues (20)

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.