Search code examples
vue.jsvue-resource

Does Vue-resource or a community library have an alternative to Angular's Services or Factories?


I am working on a larger application using Vue.js and I've been wondering if there is a better way to organize and reuse ajax requests. Currently the application is just making calls within the components (Is that good practice?). I'm coming from Angular, and I was wondering basically if there is an alternative to factories or services?


Solution

  • Vue does not offer any special functionality for this. The recommended way is to simply build your own modules and require them where you need them.