I get an Typeerror in my javascript code when defining my functions:
TypeError: (intermediate value)(...) is not a function
The function is defined as:
;(function (factory) {
if (typeof define === "function" && define.amd) {
define(["knockout", "jquery", "jquery.ui.sortable"], factory);
} else {
factory(window.ko, jQuery);
}
})(function (ko, $) {
// Some code including a bindingHandlers...
})();
This code is included in my .ascx (view) after the knockout include as:
What does the error mean and how can I track it down and fix it?
I introduce (and bind) my viewModel like this:
<script type="text/javascript">
jQuery(document).ready(function ($) {
var client = new myServiceClient(<%:ModuleContext.ModuleId%>);
client.getModel()
.done(function (model) {
var viewModel = new ViewModel(model, client);
//$("#template-load").load("DesktopModules/BBWysSceneStacker/scene-template.html")
// .success(
ko.applyBindings(viewModel, document.getElementById("<%= BBWysSceneStacker.ClientID %>"))
// )
;
})
.fail(function (model) {
alert("Error in getModel!");
});
});
</script>