ng-ajax demo

by Alex Ou

HTML

<script src="https://cdn.rawgit.com/alex-ou/ng-ajax/master/dist/ng-ajax.js"></script>
<body ng-app="myApp">
  <input type="text" ng-model="myData" ng-init="myData = 11">
  <h3>
  Here is the response:
  </h3>
  <p ng-if="isLoading">Loading</p>
  <p>{{response}}</p>
  
  <ng-ajax-control
    auto 
    debounce-duration="1000" 
    loading="isLoading">
    <ng-ajax 
      method="POST" 
      url="'/echo/json'"
      body="{title:myData}"
      ajax-error="error" 
      ajax-success="response">
    </ng-ajax>
  </ng-ajax-control>
  
</body>

JavaScript

angular.module('myApp', ['ngAjax']);