Initial KnockoutSpa template

This commit is contained in:
SteveSandersonMS
2016-03-08 12:16:22 +00:00
parent 7d7e974b5f
commit bbdbb449d5
45 changed files with 2609 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import * as ko from 'knockout';
import { Route } from '../../router';
interface NavMenuParams {
route: KnockoutObservable<Route>;
}
class NavMenuViewModel {
public route: KnockoutObservable<Route>;
constructor(params: NavMenuParams) {
// This viewmodel doesn't do anything except pass through the 'route' parameter to the view.
// You could remove this viewmodel entirely, and define 'nav-menu' as a template-only component.
// But in most apps, you'll want some viewmodel logic to determine what navigation options appear.
this.route = params.route;
}
}
export default { viewModel: NavMenuViewModel, template: require('./nav-menu.html') };