Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify dynamic composition via compose #57

Closed
simonfox opened this issue Apr 10, 2015 · 4 comments
Closed

clarify dynamic composition via compose #57

simonfox opened this issue Apr 10, 2015 · 4 comments

Comments

@simonfox
Copy link

Coming from Durandal, dynamic composition allowed a view model instance to be passed directly to the compose binding and the view would be determined dynamically based on the type of view model.

It seems this approach is not supported in Aurelia, instead you bind to a model and specify the type of view model that the compose Custom Element should create to wrap (as it is passed to activate) that model.

Is my understanding correct?
If it is, what were the reasons for not including this ability in Aurelia?

Assuming my understanding is correct, it might be worth adding a note to the docs for Durandal users to explicitly state this difference. I'd be happy to contribute this, but would like to know the reasons its not included first.

@EisenbergEffect
Copy link
Contributor

We intend to have this in Aurelia. The problem lies mostly with the way that the ES6 Module Loader spec is written. With Durandal, we were based on require.js and were able to plug in and do a little magic that enabled these dynamic scenarios. With the ES6 loader....things are locked up a bit tighter. However, there are some additions to the spec which would enable us to make this work in the future. I'm not sure when those will land, but when they do, we will fix this up.

So, in short, it's going to work, but at the moment it doesn't due to a spec-related issue. We have another issue that is tracking this, but I'll leave this open too since it's a bit clearer here.

@simonfox
Copy link
Author

Awesome news, thanks @EisenbergEffect

I'll have a look for the other issue and track that as well...

@simonfox
Copy link
Author

For anyone interested, the related issue tracking this is aurelia/templating-resources#17

@EisenbergEffect
Copy link
Contributor

@simonfox I'm going to close this issue and we'll just track this through the one referenced above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants