Hi, I am using Loopback and I am trying to incorporate this module to my server. I was trying to use the register option to attach i18n functions to the application object (normally called app).
It did not work. Looking at the source code I found the following lines in the code:
// you may register helpers in global scope, up to you
if (typeof this.register === "object") {
i18n.resMethods.forEach(function (method) {
self.register[method] = self[method].bind(self);
});
}
The I printed out typeof(app) and it turns out it's a function. Couple of comments/questions:
Why should the module care that the this.register is an object?
The code should not fail silently, it should give a warning so that we know what's going on
Hi, I am using Loopback and I am trying to incorporate this module to my server. I was trying to use the
register
option to attachi18n
functions to the application object (normally calledapp
).It did not work. Looking at the source code I found the following lines in the code:
The I printed out
typeof(app)
and it turns out it's a function. Couple of comments/questions:this.register
is an object?