src-example/client/js/app.js
/**
     * Send an HTTP request to the server, which may go via WebSocket if the
     * URL matches.
     *
     * @param  {Function} [callback]
     *   Optional callback. Invoked when the request completes.
     */
Send an HTTP request to the server, which may go via WebSocket if the
URL matches.

@param  {Function} [callback]
Optional callback. Invoked when the request completes.
Send an HTTP request to the server which may go via WebSocket if the URL matches . @param { Function } [ callback ] Optional callback . Invoked when the request completes .
function sendRequest(url, callback) {
      var index = requestStarted();
      $http({
        cache: $scope.useCache,
        method: 'GET',
        url: url
      }).then(function (response) {
        processResponse(index, true, response);
        if (callback) {
          callback();
        }
      }, function (response) {
        processResponse(index, false, response);
        if (callback) {
          callback();
        }
      });
    }
function sendRequest ( url , callback ) { var index = requestStarted ( ) ; $http ( { cache : $scope . useCache , method : 'GET' , url : url } ) . then ( function ( response ) { processResponse ( index , true , response ) ; if ( callback ) { callback ( ) ; } } , function ( response ) { processResponse ( index , false , response ) ; if ( callback ) { callback ( ) ; } } ) ; }
Send an HTTP request to the server, which may go via WebSocket if the
 URL matches.
Send an HTTP request to the server which may go via WebSocket if the URL matches .