Not a direct answer to the question, but if you're reading this SO for the reason I am this may help...
Let's say you're using ng2-translate and you really want your User.ts
class to have it. You're immediate thought is to use DI to put it in, you are doing Angular after all. But that's kind of overthinking it, you can just pass it in your constructor, or make it a public variable you set from the component (where you presumably did DI it in).
e.g.:
import { TranslateService } from "ng2-translate";
export class User {
public translateService: TranslateService; // will set from components.
// a bunch of awesome User methods
}
then from some user-related component that injected TranslateService
addEmptyUser() {
let emptyUser = new User("", "");
emptyUser.translateService = this.translateService;
this.users.push(emptyUser);
}
Hopefully this helps those out there like me who were about to write a lot of harder to maintain code because we're too clever sometimes =]
(NOTE: the reason you may want to set a variable instead of making it part of your constructor method is you could have cases where you don't need to use the service, so always being required to pass it in would mean introducing extra imports/code that are never really used)