Comments (10)
@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.
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.
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.
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.
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.
Aurelia does that. Is your question about your app code?
from aurelia.
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.
Thanks @tareqimbasher , closing this.
from aurelia.
@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.
Indeed, i was hasty, my apology.
from aurelia.
Related Issues (20)
- [refactor] remove define life cycle HOT 1
- Vite plugin for aurelia 1.x? HOT 4
- Router load attribute: broken when using id & parameters.bind HOT 7
- Injecting IHttpClient error after beta 11 update
- Router swallows DI errors HOT 7
- Restrict behavior of custom attribute single value binding and primary bindable HOT 8
- Tweak aurelia package reexports HOT 9
- Validation Package - Email validation HOT 7
- Replacing view factory containers
- Vite load issue. HOT 2
- Define `ts-jest` config under `globals` is deprecated HOT 2
- 2.0.0-beta.15 - using @inject is throwing errors HOT 3
- CSS modules support for Vite HOT 10
- [DEV:aurelia] Error: AUR0153: Element has already been registered HOT 8
- Variables getting removed from production bundle HOT 11
- [RFC] synchronous vs asynchronous binding system for Aurelia 2 HOT 9
- [feature request] ability to typecheck template
- RFC: Enhancements for Overriding Registrations in Aurelia DI Container HOT 5
- bindable decorator should not be giving a runtime error HOT 26
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurelia.