-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTMLElement as constructor argument #265
Comments
As opposed to just passing in the query selector as a string? The library grabs the HTML element the exact same way as the code above. Do you just want to be able to declare a var for your element, do stuff with it, then pass it to Typed? |
Yes, let me show you why I need this feature: Let's take this code sample (TypeScript) class SomeDialogBox {
private node: HTMLElement
public templateHTML = ''+
'<div class="dialog-content"></div><div class="dialog-btn"></div>';
constructor() {
let n = this.node = document.createElement("div");
n.innerHTML = this.templateHTML;
// this operation will return exactly THIS dialog content
let content = n.querySelector('.dialog-content');
// I cant simply put '.dialog-content' into Typed because there can multiple DialogBoxes
// so it would be great if I could put HTMLELement object instead
let t = new Typed(content, {
strings: ["Some text"],
typeSpeed: 15
});
}
} If I put |
Added to v2.0.2! As an Angular2 dev, I totally understand how this would come in handy. Thanks so much for your detailed feedback! |
Hello,
I think it would be great if user could provide
HTMLELement
instance as a container in Typed constructor:What do you think?
The text was updated successfully, but these errors were encountered: