asp.net mvc - Pass server data into root App class of Aurelia app -
when using aurelia, best way dynamic server data root view model class without having make second trip server? below super simple example:
body of root view
<body aurelia-app>   <script src="/path/to/system.js"></script>   <script src="/path/to/config.js"></script>   <script>     system.import('aurelia-bootstrapper');   </script> </body>   app.js
export class app {   name;   constructor() {   } }   app.html
<template>   ${name} </template>   if name value coming server, how can value root app class without having make second trip server? there syntax/capability in aurelia allows pass dynamic data constructor of root class via html attributes? maybe (asp.net mvc syntax used below)?
<body aurelia-app params="name: '@model.name'">   and can received via constructor this:
export class app {   name;   constructor(name) {     this.name = name;   } }   i've seen @bindable decorator, don't think works on root view, or (examples)?
 
 
  
Comments
Post a Comment