diff --git a/js/vueApp.js b/js/vueApp.js new file mode 100644 index 0000000..3894f76 --- /dev/null +++ b/js/vueApp.js @@ -0,0 +1,22 @@ +new Vue( + { + el: "#app", + data: { + listeDeSons:null + }, + created: function(){ + this.loadData(); + }, + methods: { + loadData: function() { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open( "GET", '/Sounds', false ); // false for synchronous request + xmlHttp.send( null ); + this.listeDeSons = JSON.parse(xmlHttp.responseText); + /*this.$http.get('/Sounds').then(function(response){ + this.listeDeSons = response.body; */ + + } + } + } +);