Using typescript, I am attempting to get 'modules' and 'imports' and such to work, and am having a bit of a rough time. I was asked to make an example of my problem, so here it is;
I use namespace style declaration to try and organize various parts of the project, this is just how I work the best and it helps me keep things free of a clutter that bothers me, so each typescript page starts with the namespace, and then it exports the corresponding class.
/app_content/scripts/admin/models/Item.ts
module website.admin.models {
export class Item {
// properties, etc
}
}
/app_content/scripts/admin/ui/Component.ts
module website.admin.ui {
export class Component {
// properties, etc
}
}
Then I will attempt to use one of these in a different file, as I have seen in many, many tutorials;
/app_content/scripts/admin/views/ItemView.ts
import component = module('website.admin.ui.Component');
import item = module('website.admin.models.Item');
module website.admin.views {
export class ItemView {
// try to use stuff, do other stuff, etc.
}
}
However, I get the error Module cannot be aliased to a non-module type. I have yet to get any of these imports working at all - let alone how I want them. Is there anything that can be done?
I have tried this with Visual Studio set to use both CommonJS and AMD style and such, in the properties.