nathanboktae / cherrytree-for-knockout Goto Github PK
View Code? Open in Web Editor NEWUse knockout components with CherryTree hiearchial routing
License: ISC License
Use knockout components with CherryTree hiearchial routing
License: ISC License
Currently all routeView
binding handlers have a dependency on activeRoutes
, so during a transition, that is bulk replaced, causing the entire tree to re-render. A transition at depth 3 to another sibling should not cause depth 1 and 2 to rerender. We need to do deep comparisons before attempting to call component.init
.
Also in general there may be resolve
promises that are resolved already, but will still be async and resolve on the next tick - flickering over to route-loading
during that time is a bad experience. This might be solved with the solution to the above problem.
Sometimes views that are about to be disposed anyways will have their bound querystring parameterss updated only to be thrown away immediately thereafter. This should be done after any route view model changes (additions/removals), unless there is a gotcha or adverse effect.
Hello Nathan,
I was trying to use cherrytree using require but I am having some problems. I was wondering if you could help me out.
the versions I am running are:
this is my main class
requirejs(['knockout', 'cherrytree', 'pages/home/home',
'components/greeting', 'cherrytree-for-knockout'], function (ko, cherrytree, homeComponent, greetingComponent, cherrytreefoko) {
ko.components.register('home', homeComponent);
ko.components.register('greeter', greetingComponent);
router = cherrytree();
router.map(function (route) {
route('home', homeComponent);
})
router.use(ko.bindingHandlers.routeView.middleware);
router.listen();
ko.applyBindings({ router: router }, document.querySelector('main'));
});
<main data-bind="routeView: router"></main>
the problem that is on the console says:
Uncaught (in promise) TypeError: Cannot read property 'name' of undefined(โฆ) in this line:
middlewareName = router.middleware[i].name || 'anonymous'; of cherrytree.js
It seems that I am not able to load the middleware.
Thanks a lot Nathan.
AKA the $root
for the current route view.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.