angular - @Injectable compared to plain old static methods -


i have utility class converts 1 object , vice versa.

export class converter {    public tofoo(bar: bar) : foo {}    public tobar(foo: foo) : bar {} } 

would better make class @injectable?

@injectable export class converter {    public tofoo(bar: bar) : foo {}    public tobar(foo: foo) : bar {} } 

or static method better in case?

export class converter {    static tofoo(bar: bar) : foo {}    static tobar(foo: foo) : bar {} } 


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -