On my server side, I created a simple Meteor method like this
// user.controller.ts
/// <reference path="../../typings/definitions/all-definitions.d.ts" />
Meteor.methods({
"user.controller.register": function(email: string, password: string) {
console.log(email);
}
})
However, on the when I trigger the method calling from the client side, I got “404: Method not found”. I checked the final compiled js file and this is the one
(function(){
System.register("server/controller/user.controller", [], function(exports_1) {
return {
setters:[],
execute: function() {
Meteor.methods({
"user.controller.register": function (email, password) {
console.log(email);
}
});
}
}
});
}).call(this);
and this is the part I don’t understand. I was thinking that the .ts file will be compiled to js line-by-line (or at least approximately like that). As in, final file should not have any line like “System.register…”. However, the compiled file has that and I think that on the server side, the “Meteor.methods” line is not triggered to add the new function definition to it
How can I overcome this issue ?
UPDATE:
please ignore this. problem is because I am using angular2-meteor package and I need to have the main.ts with some importing in order to load the module