Knockout add my own data-bind attribute like With
Sorry for my bad title, but I am not really sure what to call this and
properly someone can guide me in the correct direction.
I am working in Typescript and class KnockoutFileDropArea.
What I then would like to do is something like the following:
<div data-bind="with:fileDropArea">
<div data-bind="foreach:files">
</div>
</div>
The KnockoutFileDropArea has the property files ect.
Above is straight forward. Just adding a property on my viewmodel of
KnockoutFileDropArea ect. But what I need to do is when it binds my
KnockoutFileDropArea i want to do something with the HtmlElement that it
was bound for.
What can I do to attach something to the element when my
KnockoutFileDropArea is bound?
Would it be better to create a new (cant remember what they are called,
'BindingHandler'), like with. So it was something like <div
data-bind="droparea: fileDropArea">.
No comments:
Post a Comment