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

Re : Live Binding Remnants

$
0
0
Here is a breaking test which can be added to ejs_test.js
  1. test("_bindings removed when element removed", function() {
    var template = can.view.ejs('<div id="game"><% if(game.attr("league")) { %><%= game.attr("name") %><% } %></div>'),
    game = new can.Map({
            "id": "MAL",
            "name": "Fantasy Baseball",
            "league": "Malamonsters"
        });
        
        var frag = template({
         game: game
        });
    var div = document.createElement('div');
    div.appendChild(frag);
    $(div).empty();
    equal(game._bindings, 0, 'No bindings left');
    });

Viewing all articles
Browse latest Browse all 3491

Trending Articles