-
-
Save RichTeaTime/b9d508c27caabb91ba299f37b8020cff to your computer and use it in GitHub Desktop.
Aurelia Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<nav class="navbar"> | |
<a repeat.for="nav of router.navigation" href.bind="nav.href" class="nav-link ${nav.isActive ? 'active' : ''}"> | |
${nav.title} | |
</a> | |
</nav> | |
<router-view></router-view> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class App { | |
configureRouter(config, router) { | |
this.router = router; | |
config.map([ | |
{ | |
name: 'home', | |
route: ['', 'home'], | |
moduleId: 'home', | |
nav: true, | |
title: 'Home' | |
}, | |
{ | |
name: 'arrivals', | |
route: 'arrivals', | |
href: '#/arrivals', | |
moduleId: 'arrivals', | |
nav: true, | |
title: 'Arrivals' | |
}, | |
{ | |
name: 'products', | |
route: 'products', | |
href: '#/products', | |
redirect: 'arrivals/products', | |
nav: true, | |
title: 'Products' | |
} | |
]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
Arrival | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Arrival { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<nav class="navbar"> | |
<a repeat.for="nav of router.navigation" href.bind="nav.href" class="nav-link ${nav.isActive ? 'active' : ''}"> | |
${nav.title} | |
</a> | |
</nav> | |
<router-view></router-view> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Arrivals { | |
configureRouter(config, router) { | |
this.router = router; | |
config.map([ | |
{ | |
name: 'arrival', | |
route: ['', 'arrival'], | |
href: '#/arrivals/arrival', | |
moduleId: 'arrival', | |
nav: true, | |
title: 'Arrival' | |
}, | |
{ | |
name: 'products', | |
route: 'products/:index?', | |
href: `#/arrivals/products`, | |
moduleId: 'products', | |
nav: true, | |
title: 'Products', | |
activationStrategy: 'replace' | |
} | |
]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
Home | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Home { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Aurelia</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
.navbar { | |
padding-bottom: 15px; | |
} | |
.nav-link { | |
padding: 0 5px 0 0; | |
color: blue; | |
} | |
.nav-link.active { | |
color: red; | |
} | |
</style> | |
</head> | |
<body aurelia-app> | |
<h1>Loading...</h1> | |
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script> | |
<script> | |
require(['aurelia-bootstrapper']); | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
Products | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Products { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment