9 ms·
"I’m not joking: we were perfectly able to get by in one of the Angular projects developed internally — consisting of around 200 Javascript files and a total of
by fridek 11y ago
"I’m not joking: we were perfectly able to get by in one of the Angular projects developed internally — consisting of around 200 Javascript files and a total of around 10,000 lines of code — using only factories."
Funny, I could agree this is true for providers or services. Factories however can't be used for singletons, so I'd rather not know how they implemented shared state and utils.
- scotty79 11y agoFactory is just a function. It can easily instantiate and return singleton. You just call it instead of using `new` on it at the place of use. It's probably not very nice from philosophical standpoint but it can have its merits.