In your template
binding you are inside of the context of the mydata
property.
However your toAdd
and add
are defined on the root level so you need to use $root
(or $parent
depending of the nesting level) in your bindings to access them:
<input data-bind="value: $root.toAdd" />
<button data-bind="click: $root.add">Add</button>
You can read more the binding contexts in the documentation.