@profiscience/knockout-contrib-router-plugins-components
v1.0.17
Published
[![Version][npm-version-shield]][npm] [![Dependency Status][david-dm-shield]][david-dm] [![Peer Dependency Status][david-dm-peer-shield]][david-dm-peer] [![Dev Dependency Status][david-dm-dev-shield]][david-dm-dev] [![Downloads][npm-stats-shield]][npm-sta
Downloads
106
Readme
router.plugins.components
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 {}