0
「text/x-java」に設定されたモードでJavaコードを編集するために、angularjsアプリケーションでUI-codemirrorを使用しています。今私はオートコンプリートやlintのようなアドオンを使用したいと思います。UI-codemirror Addons
のオートコンプリートIでは、以下のようにkeyupとonKeyUpでオプションを設定すると、両方のイベントがトリガーされません。
コントローラでconfigureオプション:テンプレート内
_this.editorOptions = {
lineWrapping: true,
lineNumbers: true,
mode: 'text/x-java',
smartIndent: true,
tabSize: 4,
indentWithTabs: true,
tabindex: 4,
autofocus: true,
addModeClass: true,
keyup: function (e, s) {
console.log("Event Keyup");
},
onKeyUp: function (e, s) {
console.log("Event Keyup");
}
}
が指令:
<ui-codemirror ui-codemirror-opts="vm.editorOptions" ng-model="vm.activeQuestion.candidateAnswer"></ui-codemirror>
アドオンのjsスクリプトが含まれるように、どのような設定オプションのワークアウトにこれらのために設定することは何ですか?
Codemirrorディレクティブを正しく使用していますか?ディレクティブを使用している場合、コードは正しくありません。 https://github.com/angular-ui/ui-codemirror – Bik
はい、私はリンクのように実装しました。私の実装を詳細に示すために私の質問を編集しました。 –
イベントを確認する例があります: - _editor.on( "change"、function(){...}); – Bik