Skip to content

Instantly share code, notes, and snippets.

@pswanson124
Last active December 7, 2021 13:16
Show Gist options
  • Save pswanson124/39b856d2ee7ad40143df13c9ec6352aa to your computer and use it in GitHub Desktop.
Save pswanson124/39b856d2ee7ad40143df13c9ec6352aa to your computer and use it in GitHub Desktop.
testing load
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber Gist uses dumber bundler, the default bundle file
is /dist/entry-bundle.js.
The starting module is pointed to "main" (data-main attribute on script)
which is your src/main.js.
-->
<body>
<my-app></my-app>
<script src="/dist/entry-bundle.js" data-main="main"></script>
</body>
</html>
{
"dependencies": {
"aurelia": "latest",
"aurelia-direct-router": "^2.0.0-alpha.21.0"
}
}
<import from="./welcome-page.html"></import>
<div>Equaly exciting</div>
<a load="../welcome-page">back</a>
<a load="welcome-page">child context</a>
<au-viewport></au-viewport>
import Aurelia from 'aurelia';
import { MyApp } from './my-app';
import { RouterConfiguration } from 'aurelia';
//import { RouterConfiguration } from 'aurelia-direct-router';
Aurelia
.register( RouterConfiguration
// .customize({ useUrlFragmentHash: false}
)
.app(MyApp).start();
<!--
Try to create a paired css/scss/sass/less file like my-app.scss.
It will be automatically imported based on convention.
-->
<!--
There is no bundler config you can change in Dumber Gist to
turn on shadow DOM.
But you can turn shadow DOM on by adding a meta tag in every
html template:
<use-shadow-dom>
-->
<!--
<import from="./welcome-page.html"><import>
<import from="./about-page.html"><import>
<import from="./pages/search-page.html"><import>
<import from="./pages/detail-page.html"><import>
-->
<h1>${message}</h1>
<!--
<a load="welcome-page">Welcome</a>
<a load="search-page">Search</a>
<a lo-ad="about-page">About</a>
-->
<au-viewport></au-viewport>
/**/
@route({
routes : [
{
path: 'welcome-page',
component: () => import('./welcome-page'),
title: 'Home'
},
{
path: 'search-page',
component: () => import('./pages/search-page'),
title: 'Detail'
},
]
})
export class MyApp {
message = 'Hello Aurelia 2!';
}
<p>This is the search page</p>
<a load="../detail-page">search</a>
export class SearchPage {
}
<p>Welcome to this sample</p>
<a load="../-">clear</a>
export class WelcomePage {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment