-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
@noView on view-model navigated to by router throws TypeError in aurelia-templating #415
Comments
What does it mean to navigate to a route and not render anything? What should the router-view do to represent that? |
Empty viewPorts come to my mind. As a fallback for routes that don't apply a viewPort. Something like |
Apologizes, a bad choice of words. Of course I want to render something. What I do not have is anything to put into a template-based *.html file. Maybe specificity will help. I am using Auth0's "Lock" widget on a login page, and all of the relevant content will be rendered via a call to its |
Here's the current state of my view model.
|
What does that do? Does it show a popover? |
Yep. Here's a demo.
The previous screen I navigated from was being serviced by the same router. So, in my context, I was expecting the content inside of |
Ok, let me think about this. I can see a couple scenarios. Besides your own, someone actually might want to do their own custom rendering and then have that pushed into the router-view. I'm thinking that the router view should check if the view is null, if it is, it checks the view model to see if there's a |
For sure. While the third-party code I am using ignores the location of Maybe the views navigated to by the router could generate a custom element to use as a root element that would be the sole child of a By the way, take all of this from someone with about a month's experience with the framework. I may be completely failing to grasp the correct interaction of the router, views, and view models. |
This makes sense to me...then run it through the compiler and stuff onto the page. |
You can always create your own view strategies or simply implement |
Attempting to use a react component as the module targeted by a router configuration, I am attempting to use For now, the work-around for this situation is to switch such that this module is a normal aurelia view-model, which wraps a single aurelia custom element which will make use of the (edit* I just found this: #550 which contains more insight and is helpful in this particular situation) |
It is possible to create a custom element without a view by applying the
@noView
annotation on top of that custom element's view model. However, if you do the same thing to a view that is the target of a route, this line inController.automate()
inaurelia-templating
blows up because it assumes aview
property to be defined that is not.Here is a gist.run that shows the issue. If you remove the
@noView
annotation fromroute.js
, the route renders correctly.https://gist.run/?id=14a083656624a84e51731baae5511e55
After lots of reading, the closest documentation I have found on the subject is via @EisenbergEffect on Issue #238:
It sounds like this just happens to be how it works, rather than desired behavior. Should I expect this hard requirement to change? If not, what should I be doing when I do not have anything for the router to render?
The text was updated successfully, but these errors were encountered: