I am getting the error 'TabsViewModel is not a constructor' with the following code. I've looked at other posts regarding this error, but most suggest that the function name is in use somewhere else, but as you can see this is a very simple example and TabsViewModel is not used elsewhere.
define(['utils','ko','text!tmpl/risersandfallerstabs_partial.html','text!tmpl/errorPage_partial.html'], function(utils,ko,tmplrisersandfallerstabsStr,tmplErrStr) {
let tabsmodel = {};
$(function() {
tabsmodel = new TabsViewModel();
ko.components.register('risersandfallerstabs', {
viewModel: utils.createVM(tabsmodel),
template: tmplrisersandfallerstabsStr
});
utils.applyBindings(tabsmodel,'risersandfallerstabs');
var TabsViewModel = (function(){
let self = {};
self.test = "123";
return self;
});
});
})
Why am I getting this error?