Hacker News new | past | comments | ask | show | jobs | submit login

I think modules become also really powerful to build and/or extract the framework that your app needs. In other words, distilling your framework out of your app.

I look at them as a way to extract those building blocks that support the business logic in your app such as a data store or driving app state through routes (whether you roll out your own or use third party libraries). Even if you rely on third party libraries to fill those gaps, I like having my controllers/services/directives not to depend directly on them. For example, in the last year I've transitioned from ng-routes, to ui-router and finally settled with dotJEM/angular-routing [1]. Something similar happened when using $resource, then switched to Restangular, to finally use a thin data store on top of $http [2].

Having that code in a separate layer helped identifying service boundaries within the app and made it easier to replace them when needed.

[1] https://github.com/dotJEM/angular-routing

[2] Something similar to the following implementation: https://github.com/vicentereig/hola-apps/blob/master/app/ass...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: