Knockout bindings for CodeMirror or Ace

539 views
Skip to first unread message

Htbaa

unread,
Jan 6, 2012, 4:07:56 PM1/6/12
to KnockoutJS
Hello list,

I'm still new to KnockoutJS, but have been following this project for
some time now. Currently I'm prototyping some ideas and want to
combine Knockout with CodeMirror (http://codemirror.net/) or Ace
(https://github.com/ajaxorg/ace), but I'm currently leaning more
towards CodeMirror.

Aside from my choice of editor to use I figured as much as needing to
write a binding handler to either of them. I've tried following the
TinyMCE example (https://github.com/SteveSanderson/knockout/wiki/
Bindings---tinyMCE) but so far haven't had much success. I couldn't
find an existing example for either of them, so I'm turning to here.

I read that http://learn.knockoutjs.com makes use of CodeMirror, but
the source code is minified, and I'm not sure if it actually uses any
binding.

Is there anyone that has combined CodeMirror or Ace with Knockout and
who is willing to share how this can be done?

Thanks.

Htbaa

unread,
Jan 6, 2012, 5:35:17 PM1/6/12
to KnockoutJS
For now I've fixed my problem by simply updating the value of my
viewmodel whenever the content of the editor is being updated.

Probably not the cleanest solution, but it works. Still I'd like to
hear if a binding solution such as with TinyMCE is possible, and how.

On 6 jan, 22:07, Htbaa <i...@htbaa.com> wrote:
> Hello list,
>
> I'm still new to KnockoutJS, but have been following this project for
> some time now. Currently I'm prototyping some ideas and want to
> combine Knockout with CodeMirror (http://codemirror.net/) or Ace
> (https://github.com/ajaxorg/ace), but I'm currently leaning more
> towards CodeMirror.
>
> Aside from my choice of editor to use I figured as much as needing to
> write a binding handler to either of them. I've tried following the
> TinyMCE example (https://github.com/SteveSanderson/knockout/wiki/
> Bindings---tinyMCE) but so far haven't had much success. I couldn't
> find an existing example for either of them, so I'm turning to here.
>
> I read thathttp://learn.knockoutjs.commakes use of CodeMirror, but
Reply all
Reply to author
Forward
0 new messages