From: José Bollo Date: Wed, 8 Jun 2016 05:52:44 +0000 (+0200) Subject: Avoids javascript errors X-Git-Tag: blowfish_2.0.1~42 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=7c8b8a78f9029d8568a89e5f2a27c88a75b1daa2 Avoids javascript errors But doesn't make AfbAngular functionnal. Change-Id: I643c81792fa757710327a8f66a79a1c8173ebe75 Signed-off-by: José Bollo --- diff --git a/test/AfbAngular.js b/test/AfbAngular.js index 3db1ad59..71338cf9 100644 --- a/test/AfbAngular.js +++ b/test/AfbAngular.js @@ -35,16 +35,24 @@ this.ws = null; } + // prototype of functions linked to AfbContext object AfbContext.prototype = { + // call using websockets call: function(method, query) { return getws(this).call(method, query); }, + + // call using get get: function(method, query) { return $http.get(this.uhttp+method, mixtu(this, query)); }, - post: function(method, query) { return $http.post(this.uhttp+method, mixtu(this, query)); }, + + // call using post + post: function(method, query) { return $http.post(this.uhttp+method, mixtu(this, query)); } }; + // get the current websocket function getws(ctxt) { return ctxt.ws || (ctxt.ws = new AfbWebSocket(ctxt)); } + // inserts the current token in the answer function mixtu(ctxt, query) { return ("token" in query) ? query : angular.extend({token:ctxt.token},query); } @@ -131,6 +139,7 @@ +/* @@ -173,6 +182,8 @@ function call(method, request) { } +*/ + /* // Factory is a singleton and share its context within all instances. AfbClientModule.factory('AppCall', function ($http, AppConfig, $log) {