Giter Site home page Giter Site logo

Comments (10)

bigopon avatar bigopon commented on May 30, 2024

@tareqimbasher can you try with latest beta? it's possible that it's been already fixed, since this looks like a very common scenario.

from aurelia.

tareqimbasher avatar tareqimbasher commented on May 30, 2024

Unfortunately not in any timely manner, the latest beta (v15) requires a nontrivial change to decorator usage. That effort however is contingent on having a working app which this issue is blocking. I do see this issue in beta v14 as well.

I'm hoping I can try reproducing this issue in a standalone app to see if v15 would resolve it.

from aurelia.

tareqimbasher avatar tareqimbasher commented on May 30, 2024

Is my expectation that a new custom element instance should be returned everytime a correct one? Regardless if it's used within a au-compose rendered block/element or not? And regardless if the custom element is used in a template or resolved directly from the container (container.get(ViewModel)) without the need for newInstanceOf?

from aurelia.

bigopon avatar bigopon commented on May 30, 2024

the latest beta (v15) requires a nontrivial change to decorator usage

beta 14 can do, there shouldn't be differences between them with regards to this.

container.get(ViewModel)

this does not result into a new instance, this will follow the standard resolution mode of container.get(). @Sayan751 asked about it too. Having container.get() using different way of resolution is considered inconsistent and thus it was changed from always a new instance to always a singleton.

If you want a new instance, use invoke:

container.invoke(ViewModel)

from aurelia.

tareqimbasher avatar tareqimbasher commented on May 30, 2024

Got it, thank you for that last part, that is definitely different than how it was in beta.11.

So just to be sure, is my expectation that a new instance should be created everytime when used in a HTML template correct?

from aurelia.

bigopon avatar bigopon commented on May 30, 2024

Aurelia does that. Is your question about your app code?

from aurelia.

tareqimbasher avatar tareqimbasher commented on May 30, 2024

My question is what does Aurelia do, which you've answered, thank you. I just didn't want to be expected something that the framework isn't doing by design.

from aurelia.

bigopon avatar bigopon commented on May 30, 2024

Thanks @tareqimbasher , closing this.

from aurelia.

tareqimbasher avatar tareqimbasher commented on May 30, 2024

@bigopon thank you for answering my questions so far but I believe this issue shouldn't be closed yet as the issue I'm experiencing remains unresolved. I have yet to complete a standalone repro to determine if the problem I described is a change in behavior or some weird glitch specific to my app code.

from aurelia.

bigopon avatar bigopon commented on May 30, 2024

Indeed, i was hasty, my apology.

from aurelia.

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.