this.fetch = function() {
self.clear();
- self.url = '/g/' + self.function + '/' + self.args + '?callback=JSON_CALLBACK';
+ self.url = '/g/' + self.function_name + '/' + self.args + '?callback=JSON_CALLBACK';
$xhr('JSON', self.url, function(code, response) {
self.code = code;
self.response = response;
};
this.clear = function() {
+ self.url = null;
self.code = null;
self.response = null;
};
PingCntl.$inject = ['$xhr'];
</script>
<div ng:controller="PingCntl">
- <input type="text" name="function" value="CRM_username" size="20"/>
+ <input type="hidden" name="function_name" value="CRM_search" size="20"/>
<input type="text" name="args" value="test" size="10"/>
<button ng:click="fetch()">fetch</button>
<button ng:click="clear()">clear</button>
<b ng:show="url && ! code">loading {{url}}</b>
+ <b ng:show="response">{{response.length}} results</b>
<table ng:show="response">
<tr>
<th>USERNAME</th>
<td>{{u.OPT82}}</td>
</tr>
</table>
- <pre>
+ <input type=checkbox name=debug value=1>
+ <pre ng:show=debug>
url={{url}}
code={{code}}
response={{response}}