So, if I code my recipe.js file as follows, is that ok?
steal('jquery/model', function(){
/**
* @class Cookbook.Models.Recipe
* @parent index
* @inherits jQuery.Model
* Wraps backend recipe services.
*/
$.Model('Cookbook.Models.Recipe',
/* @Static */
{
findAll: function(params, success, error){
var vars = "{ 'tableName' : 'recipe', 'id' : '' }";
var response = $.ajax({
type: "POST",
url: "/WebService1.asmx/recipes",
dataType: "json",
contentType: "application/json",
data: vars
});
return response.d;
},
findOne : "/recipes/{id}.json",
create : "/recipes.json",
update : "/recipes/{id}.json",
destroy : "/recipes/{id}.json"
},
/* @Prototype */
{});
})
steal('jquery/model', function(){
/**
* @class Cookbook.Models.Recipe
* @parent index
* @inherits jQuery.Model
* Wraps backend recipe services.
*/
$.Model('Cookbook.Models.Recipe',
/* @Static */
{
findAll: function(params, success, error){
var vars = "{ 'tableName' : 'recipe', 'id' : '' }";
var response = $.ajax({
type: "POST",
url: "/WebService1.asmx/recipes",
dataType: "json",
contentType: "application/json",
data: vars
});
return response.d;
},
findOne : "/recipes/{id}.json",
create : "/recipes.json",
update : "/recipes/{id}.json",
destroy : "/recipes/{id}.json"
},
/* @Prototype */
{});
})