I have a set of simple tool methods, without any state to share along the app, not need to be a singleton and without any injected services.
Do I have any advantage to use a injectable service :
@Injectable()
export class DateService {
public convertStringToDate(input: string): Date {
…
}
public convertDateToString(date: Date): string {
…
}
…
}
versus a simple set of export/import functions (or basic JS module)?
export function convertStringToDate(input: string): Date {
…
}
export function convertDateToString(date: Date): string {
…
}
…
I'm working on a app mixing both method and I confused about the advantage of each others.