var Templates;
var registerTemplate;

require(['scripts/knockout-3.3.0', 'viewModel', 'scripts/jquery-2.1.1.min','scripts/act.js'], function(ko, viewModel) {
	
	registerTemplate = function(obj) {
		console.log("register template...");
		ko.components.register(obj.Name, {
			viewModel: { require: obj.Model },
			template: obj.Template
		});
	};
	
	console.log("load templates...");
	Templates = new ACTSocket("Templates");
	Templates.onmessage = registerTemplate;
	
    ko.applyBindings(new viewModel());
});
