-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #340 from canjs/teardown
Teardown bindings when a nodeList in unregistered
- Loading branch information
Showing
2 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<title>Memory tests</title> | ||
<button type="button">Run me</button> | ||
<div id="root"></div> | ||
<script src="../node_modules/steal/steal.js"></script> | ||
<script type="steal-module"> | ||
var Component = require("can-component"); | ||
var nodeLists = require("can-view-nodelist"); | ||
|
||
var MyComponent = Component.extend({ | ||
tag: "my-thing", | ||
view: "Hello world" | ||
}); | ||
|
||
function run() { | ||
var inst = new MyComponent(); | ||
nodeLists.unregister(inst.nodeList); | ||
} | ||
|
||
document.querySelector('button').addEventListener('click', run); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters