javascript - Register Knockout.js component viewmodel from module in typescript -
my viewmodel module has several classes, want register spesific class component's viewmodel.
and says: component 'filter-table': unknown viewmodel value: [object object]
this have in viewmodel module
module filtervm { export class filterviewmodel { //some code } class filtertableviewmodel { } class attributetableviewmodel { } class layerattributeviewmodel { } } export = filtervm;
and trying register
import filtervm = require('scripts/app/components/attributetable/viewmodels/filterviewmodel'); ko.components.register('filter-table', { viewmodel: { require: filtervm.filterviewmodel }, template: { require: 'text!scripts/app/components/attributetable/views/filtertableview.html' } });
what wrong that?
solved
the problem here viewmodel: { require: filtervm.filterviewmodel }
should viewmodel: filtervm.filterviewmodel
Comments
Post a Comment