pkozlowski-opensource / angularjs-mongolab

Resource-like factory for MongoLab based on $http and working with promises

Home Page:http://plnkr.co/edit/Bb8GSA?p=preview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I can pass a dinamic collection?

marcoriesco opened this issue · comments

As I spend a dynamic collection to the factory?

I'm trying some ways and still can not, I tried to pass the parameter :collection, but does not.

Any idea?

.factory('ALL', function($mongolabResourceHttp) {
//Here get the collection, pass from controller...
return $mongolabResourceHttp(COLLECTION);
})

CONTROLLER:
ALL.all(COLLECTION, { limit: 10 }).then(function(response) {
$scope.dashboardposts = response.data;
});