javascript - AngularJS assign different params and functions -


It may not be an AngularJS problem but I think I'm new to understanding what I'm doing Am wrong here Can you push me in the right direction? I tried to get depressedness from 3 hours and later: - (

I have a function in which I pass my SQL questions with other parameters. This function will be flexible as much as possible.

  prepareQuery (choose from names' where id = ', [$ scope.listId], listnameResultHandler (), defaultErrorHandler ()); prepareQuery (?) (Select' products * From ', [], defaultResultHandler (), defaultErrorHandler ());  

To explain this:

  1. Ultimate: SQL Quay
  2. Ultimate: Bind the query
  3. Ultimate: If success is possible, then the query is possible
  4. The ultimate: error-function, if there is a problem < / Li>

Now it is that prepare-function:

  function prepareQuery (query, ultimate, successHandler, errorHandler) {$ scope.db.transaction (function (TX } {Tx.executeSql (query, ultimate, successHandler, errorHandler);}, errorCB;}  

The problem is that I always get an answer from the default error handler ().

  function defaultErrorHandl Er (err) {warnings ("error in SQL processing:" + err.code); }  

And always says an error: Undefined .

You have to pass the function pointer, and they should not actually call the function name After bracket removal, defaultResultHandler

  prepareQuery ('Select names from names where id = (?)', [$ Scope.listId], listnameResultHandler, defaultErrorHandler); Prepare ('Select * Product from', [], defaultResultHandler, defaultErrorHandler);  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -