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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -