Aurelia recently added layout support, and they roughly explained these in their documentation .
However, although I managed to get the layout itself to work, I cannot use any variables in my HTML layout that I have as properties in my layout.
A MWE:
app.ts
import {Router, RouterConfiguration} from 'aurelia-router'; export class App { router: Router; configureRouter(config: RouterConfiguration, router: Router) { config.map([ { route: 'hello', layoutViewModel: 'layout/main', moduleId: 'hello/index' }, ]); } }
Layout / main.ts
export class MainLayout { heading = 'Hallo Welt'; }
layout /main.html
<template> <h1>${heading}!</h1> </template
But only an exclamation mark appears. Do you have any idea what I'm doing wrong or how can I make it work?
Thank you very much in advance!
source share