Hey, I’m having another ‘(how) is this possible’ question for aurelia:
Simple put: “is it possible to have multiple views for the same viewmodel”? Say I have a viewmodel called “DataViewModel”.
Now this data contais a student ID, an portrait picture, a name an adress. And the viewmodel makes those accessible for the view.
Now this viewmodel used by different views (at different times during the lifecycle of the application): one view would display “thumbnail + alttext”. While another would be a list-item that display detailed data.
In aurelia it seems everything is view-centered instead of viewmodel-centered, to use a “custom element” I have to create x.html and x.js/ts. And I’d add it by first adding an event:
Yet if I wish to use creat a different view (or even rename my viewmodel files so they are clearly different from the views, and even in a different folder), I’d also have to create another viewmodel? That seems rather silly. - Can’t I do something like:
<thumb_student_view view-model="student_view_model" student.bind="theStudent"></thumb_student_view>