I ran into a small problem.
I have a SPA application I'm writing in knockoutjs.
I'm using yeoman for the scaffolding.
There's a header and a footer which remains the same.
Each page content i.e. the viewmodel and html is located inside a directory which lies inside the components directory.
I have a dropdown component which I want to place inside another component. For some reason, it doesn't appear. The name of my component is period-dropdown.
The name of the file of my component is period-dropdown.js The name of the template (html) file of my component is period-dropdown.html Both resides in the same directory period-dropdown The period-dropdown resides inside the components directory
Here's the VM of my component:
define('period-dropdown', ['knockout', 'text!./period-dropdown.html'], function (ko, templateMarkup) {
function PeriodDropdown(params) {
}
return { viewModel: PeriodDropdown, template: templateMarkup };
});
Here is the way that component is registered:
ko.components.register('period-dropdown', {require: 'components/period-dropdown/period-dropdown' });
I placed the html for that component inside my content page (which is also a component)
<period-dropdown></period-dropdown>
The period-dropdown component is not loaded and I get the error:
Uncaught Error: Load timeout for modules: components/period-dropdown/period-dropdown
What am I doing wrong?
thanks for the help