This file contains 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
const fs = require('fs') | |
const path = require('path') | |
// absolute paths to all symlinked modules inside `nodeModulesPath` | |
// adapted from https://github.com/webpack/webpack/issues/811#issuecomment-405199263 | |
module.exports = function findLinkedModules(nodeModulesPath) { | |
const modules = [] | |
fs.readdirSync(nodeModulesPath).forEach(dirname => { | |
const modulePath = path.resolve(nodeModulesPath, dirname) |
This file contains 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
pub struct Ctx { | |
pub db: request::PooledConnection, | |
} | |
impl Context for Ctx {} | |
pub fn context_factory(req: &mut Request) -> Ctx { | |
Ctx { | |
db: request::get_db(req), | |
} |
This file contains 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> | |
<style> | |
.active a { color: red; font-weight: bold; } | |
</style> | |
<ul> | |
<li > | |
<a href="#viewmodel-with-subrouter/shared-parent/child-a">child a</a> | |
</li> | |
<li > | |
<a href="#viewmodel-with-subrouter/shared-parent/child-b">child b</a> |
This file contains 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> | |
<style> | |
.active a { color: red; font-weight: bold; } | |
</style> | |
<ul> | |
<li > | |
<a href="#viewmodel-with-subrouter/shared-parent/child-a">child a</a> | |
</li> | |
<li > | |
<a href="#viewmodel-with-subrouter/shared-parent/child-b">child b</a> |
This file contains 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> | |
<style> | |
.active a { color: red; font-weight: bold; } | |
</style> | |
<ul> | |
<li > | |
<a href="#viewmodel-with-subrouter/shared-parent/child-a">sdsdfsdf</a> | |
</li> | |
</ul> | |
<router-view></router-view> |
This file contains 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> | |
<style> | |
.active a { color: red; font-weight: bold; } | |
</style> | |
<ul> | |
<li > | |
<a href="#viewmodel-with-subrouter/shared-parent/child-a">sdsdfsdf</a> | |
</li> | |
</ul> | |
<router-view></router-view> |
This file contains 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> | |
<style> | |
.active a { color: red; font-weight: bold; } | |
</style> | |
<ul> | |
<li repeat.for="row of router.navigation" class="${row.isActive ? 'active' : ''}"> | |
<a href.bind="row.href">${row.title}</a> | |
</li> | |
</ul> | |
<router-view layout-view="shared-parent.html" layout-view-model="shared-parent"></router-view> |
This file contains 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> | |
<p>The problem with this solution is that the current state is not set correctly for Shared Parent - child a</p> | |
<p>This is because of duplicate "route" attributes in the app router.</p> | |
<p>But on the positive side - here it does at least work, setting the heading in the parent from the children by DI, which is an issue if you go the "layout view" route instead like this: <a href="https://gist.run/?id=66eeff540a4665694a31482b790bf01e">https://gist.run/?id=66eeff540a4665694a31482b790bf01e</a></a></p> | |
<!--<ul> | |
<li><a href="#shared-parent/child-a">#shared-parent/child-a</a></li> | |
<li><a href="#shared-parent/child-b">#shared-parent/child-b</a></li> | |
<li><a href="#shared-parent2/child-a">#shared-parent2/child-a</a></li> | |
<li><a href="#shared-parent2/child-b">#shared-parent2/child-b</a></li> | |
</ul>--> |
This file contains 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> | |
<style> | |
.active a { color: red; font-weight: bold; } | |
</style> | |
<ul> | |
<li repeat.for="row of router.navigation" class="${row.isActive ? 'active' : ''}"> | |
<a href.bind="row.href">${row.title}</a> | |
</li> | |
</ul> | |
<router-view layout-view="shared-parent.html" layout-view-model="shared-parent"></router-view> |
This file contains 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> | |
<router-view layout-view="default.html" layout-view-model="default"></router-view> | |
</template> |
NewerOlder