Use third party library in a angular factory
<p>This is my factory: </p>

<pre><code>.factory('DataService',['$http',function($http, Backand ){
    var data = [];
    return {
        GetData: function(){
            return $http.get(Backand.getApiUrl() + '/1/objects/details').then(function(response){
                data = response;
                return response;
            });
        },
        GetElem: function(personId){
            for(i=0;i&lt;data.length;i++){
                if(data[i].id == personId){
                    return data[i];
                }
            }
        }
    }

}]);
</code></pre>

<p>Now the problem. The third party library <code>Backand</code>is correctly injected but i get the error: <code>Cannot read property 'getApiUrl' of undefined</code></p>

<p>So Backand is undefined. When i use Backand in a controller everything work just fine. </p>

<p>What should i do to fix this?</p>