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

Re : Bind and events understanding

$
0
0
Exactly. "recipe.destroy()" does not send DELETE query. This can be seen in the console. There's only a GET request . In the database there is no change . Moreover , making console.log(recipe.destroy()); I get an empty object .

At the same time , the code below works fine, I get a DELETE request to the server, but , the event does not work again :(
  1.         Recipe = can.Model.extend({
                destroy : "DELETE /collection/{id}",
                findOne : "GET /collection/{id}"
            },{});

            Recipe.bind("destroyed", function(){
                console.log("a recipe destroyed");
            });
           
            Recipe.destroy(125);

Viewing all articles
Browse latest Browse all 3491

Trending Articles