--- /dev/null
+<!doctype html>
+<html xmlns:ng="http://angularjs.org">
+ <script src="http://code.angularjs.org/angular-0.9.12.min.js" ng:autobind></script>
+ <body>
+ <script>
+ function PingCntl($xhr) {
+ var self = this;
+
+ this.fetch = function() {
+ self.clear();
+ self.url = '/g/' + self.function + '/' + self.args + '?callback=JSON_CALLBACK';
+ $xhr('JSON', self.url, function(code, response) {
+ self.code = code;
+ self.response = response;
+ });
+ };
+
+ this.clear = function() {
+ self.code = null;
+ self.response = null;
+ };
+ }
+ PingCntl.$inject = ['$xhr'];
+ </script>
+ <div ng:controller="PingCntl">
+ <input type="text" name="function" value="ping" size="20"/><br/>
+ <input type="text" name="args" value="localhost" size="10"/><br/>
+ <tt>{{url}}</tt>
+ <button ng:click="fetch()">fetch</button>
+ <button ng:click="clear()">clear</button>
+ <pre>code={{code}}</pre>
+ <pre>response={{response}}</pre>
+ </div>
+ </body>
+</html>