In Aurelia I currently can't bind to a field from parent (app.ts
) in landing page.
If I explicitly use $parent
, I get an exception telling me that $parent
ist not defined.
If I route to another page and go back to the landing page $parent
is defined now and I can access fields from parent directly without usage of $parent
keyword.
I'm sure it word earlier but I think some updated package breaks it. (Didn't recognised it after update)
<h1>${testString}</h1><!-- Nothing displayed -->
<h1>${$parent.testString}</h1><!-- ERROR [app-router] TypeError: Cannot read property 'testString' of undefined -->
Both dont work initially after page load but after routing back to this page.
What am I missing?
Using aurelia-binding 2.1.5, aurelia-framework 1.3.0, aurelia-router 1.6.3
app.ts
as$parent
? Are you using<compose>
or using a custom element? - Jesse<template>${$parent.testString}</template>
on the page. - user1127860