Working with OfflineJS and AngularJS
<p>I am working on an angular app where I want to integrate <strong>OfflineJS</strong> functionality.
I have created a general service for getting and posting data to/from an API,and a specific service for each module.
Here is the code</p>

<pre><code>    app.service('MethodProvider', function ($http) {
    var self = this;
    self.get = function (url) {
        var obj = {
            url: url,
            method: 'GET',
            async: true,
            headers: {
                'Content-Type': 'application/json'
            }
        };
        return $http(obj);
    };
    self.post = function (url, data) {
        var obj = {
            url: url,
            method: 'POST',
            async: true,
            data: JSON.stringify(data),
            headers: {
                'Content-Type': 'application/json'
            }
        };
        return $http(obj);
    };
    self.put = function (url, data) {
        var obj = {
            url: url,
            method: 'PUT',
            async: true,
            headers: {
                'Content-Type': 'application/json'
            }
        };

        if (typeof data != 'undefined' &amp;&amp; data != null) {
            obj.data = JSON.stringify(data);
        }
        return $http(obj);
    };
    self.delete = function (url) {
        var obj = {
            url: url,
            method: 'POST',
            async: true,
            headers: {
                'Content-Type': 'application/json'
            }
        };
        return $http(obj);
    };
    return self;
});
</code></pre>

<p>And a specific module service like User module</p>

<pre><code> app.service('UserSrvc', function (MethodProvider) {
    var self = this;
    self.create = function (data) {
        var url = apiUrl + '/user/add';
        return MethodProvider.post(url, data);
    };
    return self;
});
</code></pre>

<p>How do I integrate <strong>OfflineJS</strong> in this code , I want to intercept HTTP request when network connectivity is down and resume requests when network connectivity is up . I have studied this <a href="http://www.andygup.net/offline-javascript-part-3-intermittent-offline/" rel="nofollow">example</a> but unable to integrate this in angular need an example to get started.</p>