Created
February 24, 2012 10:10
-
-
Save tanabe/1899926 to your computer and use it in GitHub Desktop.
buggy component
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
//1 to 4 | |
Component.prototype.initialize = function(element) { | |
//not good | |
//4. this handler is still alive. | |
model.method("create").observe(this.handler); | |
}; | |
Component.prototype.handler = function() { | |
//not good | |
//3. manipulate element but, element is not exists on DOM tree. | |
}; | |
//1. create component | |
registerElement: function(element) { | |
//not good. useless instance | |
var component = new Component(element); | |
} | |
//2. remove component element from DOM tree. | |
componentElement.remove(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment