onLoad doesn't work as expected, like other configuration options
quietlyconfident opened this issue · 0 comments
Depending on which documentation you look at, onLoad looks like any other configuration option. But it only works when called in a very specific way which makes it different than other configuration options, and more difficult to use.
In the documentation here: http://angular-ui.github.io/ui-codemirror/ , It looks like you can set ui-codemirror to be equal to a JSON string representation of a configuration hash.
And, in the documentation here: https://github.com/angular-ui/ui-codemirror , it looks like one of the options in that hash can be onLoad ; and also that instead of setting it in the markup you can set it in the opts.
However, at least in my experience so far, you can't set 'onLoad':'someScopeFunc' in the configuration-opts hash, it is ignored. And, you can't pass ui-codemirror="{'onLoad':'someScopeFunc'}" in the markup, the quotes mess it up.
In my view, onLoad should be made to work like any other configuration option, in the -opts hash, and should function when specified as valid JSON (e.g. with quotes around the key and value).