-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Aurelia tries to set bindingContext when there is no View #238
Comments
Can you create a small, simple reproduction, zip it up and attach it here? along with steps to reproduce the issues. That would help us find the problem. |
I guess he's trying the same like me. So using the noView on a viewModel seems to be not working. import {noView} from 'aurelia-framework';
import {Redirect} from 'aurelia-router';
@noView
export class SomeViewModel {
constructor() {
// Some service call and redirect
new Redirect('');
}
} |
@EisenbergEffect I'm really sorry but I think I've lost the code that was causing this problem. I'll try to go back in my project's commit history to find it though, but it may take some time before I have the time to do so. |
Definitely using Redirect in a constructor won't work. The Redirect instance would need to be returned from the canActivate hook, at the earliest. But currently, the router enforces that all view models that get rendered must have a View. We may be able to change that in the future though. |
Oh, sorry for the confusion, I wasn't using a Redirect instance, I was running the
|
Isn't adding a |
Can pipeline steps be asynchronous?
|
Yes, you can return a promise. I don't follow on:
Returning a promise in the activate method also delays the rendering. |
Yes, but you don't need to return the Promise - you can just create it. I On Wed, Jan 20, 2016 at 12:09 PM StrahilKazlachev notifications@github.com
|
Looks like this was solved. |
I'm doing a Redirect before the view is created, yet Aurelia still tries to execute the binding, which causes an error:
This line throwing the error is here:
templating/src/controller.js
Line 69 in 5ee79b7
It's hard for me to pinpoint the exact source of the problem.
The text was updated successfully, but these errors were encountered: