Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Connecting the markup to a client side model when aurelia enhancing t…
…he server side rendered razor view
- Loading branch information
Showing
with
41 additions
and 7 deletions.
@@ -1,12 +1,15 @@ | ||
@{ | ||
ViewData["Title"] = "About"; | ||
} | ||
<div th-aurelia-enhance="true"> | ||
<div th-aurelia-enhance-module="app/views/home/home-about"> | ||
<section> | ||
<h2>@ViewData["Title"]</h2> | ||
<p>Use this area to provide additional information.</p> | ||
</section> | ||
<section> | ||
Take me to the <a route-href="route: MvcRoute; params.bind: { mvcController: 'Home', mvcAction: 'Contact' }">Contact page</a> | ||
</section> | ||
<section> | ||
<button type="button" click.delegate="showMessage()">Show message</button> | ||
</section> | ||
</div> |
@@ -0,0 +1,9 @@ | ||
export function create() { | ||
return new HomeAboutClientModel(); | ||
} | ||
|
||
class HomeAboutClientModel { | ||
showMessage() { | ||
alert('Hello World!'); | ||
} | ||
} |