Skip to content

Comment on Get rid of `this` in your JavaScript code

Comments

Aye, in AngularJS we often use

    var serviceInterface = {};

    // a bunch of code for the service/factory/provider

    return serviceInterface;
I personally think of services/factories/providers as "implementation details" which I group as "client-side services". "Services" in this phrase does not have the same meaning as "service" in Angularese, and this helps me think more clearly more often than not about how my code relates to my goal, so "serviceInterface" is really a shorthand for "clientsideServiceInterface".
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.