2 <html xmlns:ng="http://angularjs.org">
3 <script src="http://code.angularjs.org/angular-0.9.12.min.js" ng:autobind></script>
6 function PingCntl($xhr) {
9 this.fetch = function() {
11 self.url = '/g/' + self.function + '/' + self.args + '?callback=JSON_CALLBACK';
12 $xhr('JSON', self.url, function(code, response) {
14 self.response = response;
18 this.clear = function() {
23 PingCntl.$inject = ['$xhr'];
25 <div ng:controller="PingCntl">
26 <input type="text" name="function" value="ping" size="20"/><br/>
27 <input type="text" name="args" value="localhost" size="10"/><br/>
29 <button ng:click="fetch()">fetch</button>
30 <button ng:click="clear()">clear</button>
31 <pre>code={{code}}</pre>
32 <pre>response={{response}}</pre>