S
S
shipovalovyuriy2015-06-11 18:42:43
Angular
shipovalovyuriy, 2015-06-11 18:42:43

How can you pass a variable to a factory?

How can I pass the "sql" argument to the factory?
And how it is possible to address then to function through the controler?

searchApp.factory('DataProvider',function($http,$q){

  return {

          getManufactures:getManufactures(),
          getCategoryTree:getCategoryTree(),
          getProducts:getProducts(sql),

  };

Answer the question

In order to leave comments, you need to log in

1 answer(s)
4
4ikist, 2015-06-11
@shipovalovyuriy

Remove function calls, indicate the presence of an argument in the implementation, and you will be able to access: DataProvider.getProducts(sql)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question