Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

How do i implement findAll?

$
0
0
Hey guys, i have the following:

findAllAddressSuggestions: function(params, success, error) {
        try {
        console.log('CustomerAddress:findAllAddressSuggestions params:', params);
               return $.ajax({
            url: '/myapi',
            data: params,
            type: 'get',
            dataType: 'json',
                   success: success,
                   error: error});
        } catch (err) {
        console.log('CustomerAddress:findAllAddressSuggestions threw exception with err:',err);
        throw err;
        }
    },

And i call it like this:


Model.findAllAddressSuggestions({
  formatted_address:'search...'}, function(data){
    console.log('success data:',data);
  },function(data){
    console.log('err data:',data);
  });


But my success data is stright up JSON resposne... not a model or a list :/ which is what i am expecting to get...

Any help would be appreciated

Viewing all articles
Browse latest Browse all 3491

Trending Articles