vHttpService
Simple and lightweight Http Services for Vue.js.
Installation
Install via npm
$ npm install vhttpservice
Sample usage
Include scripts
<script src="http://cdn.jsdelivr.net/vue/1.0.16/vue.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/vue-resource/0.1.17/vue-resource.min.js"></script> // Include after loading the vue and vue-resource.<script src="/dist/vHttpService.min.js"></script> <script src="/js/UserController.js"></script>
// Quick Sample usage on signing up new user account// Should be somewhere on your UserController.js files { "use strict"; el: '#singUp' data: oUsers : {} methods : { // success callback var { // Manage response here.. console; }; // Data bind from the signup form var oData = thisoUsers // Invoke vHtpp.send('url', 'method', objData, fnSuccessCallback); vHttp; } { // Just like the create methods, //should set oData //should create your success callback inside this scope vHttp; } { // Just like the create methods, //should set oData //should create your success callback inside this scope vHttp; } { // Just like the create methods, //should set oData //should create your success callback inside this scope vHttp; } ; };
License
MIT © Rexon A. De los Reyes