由于this problem,我试图使用另一个基于JavaScript的源编辑器而不是CodeMirror和Ace,它可以与 AngularJS 1.X
一起使用 . 我正在调查Monaco Editor .
我完全可以运行this sample . 但我不知道如何使它与AngularJS 1.X一起使用 .
例如,我想将 ng-if
, ng-model
和 ng-change
绑定到编辑器,以决定何时以及显示什么,并在有任何更改时运行函数 . 使用ui-codemirror,我们可以使用指令编写:
<textarea ng-if="condition" ng-change="change(content)" ng-model="content" ui-codemirror="{ mode: 'application/json' }"></textarea>
那么有人知道摩纳哥编辑是否有这样的 ui-
指令?在角度框架内是否有任何解决方法可以实现相同的功能?
1 回答
我开始通过模仿ui-codemirror来编写ui-monacoeditor . 它尚未完成,但适用于我的有限使用 .