knockout-contrib

:metal: KnockoutJS Goodies Monorepo

View the Project on GitHub Profiscience/knockout-contrib

router.plugins.components

Version Dependency Status Peer Dependency Status Dev Dependency Status Downloads

Register components only for the life of the page (unregister before dispose).

Allows breaking views into multiple components while helping to avoid naming conflicts.

Usage

import { Route, componentsRoutePlugin } from '@profiscience/knockout-contrib'

Route.usePlugin(componentsRoutePlugin)

new Route('/', {
  components: () => ({
    // will register the <toolbar></toolbar> component for use in this view and its children
    toolbar: import('./toolbar'),
  }),
})

toolbar.ts

export const template = 'Hello, World!'
export class viewModel {}