You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 youif(typeofthis.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
The text was updated successfully, but these errors were encountered:
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?The text was updated successfully, but these errors were encountered: