0

由于this problem,我试图使用另一个基于JavaScript的源代码编辑器,而不是CodeMirror和Ace,它可以与AngularJS 1.X一起使用。我当时正在调查Monaco Editor在AngularJS 1.X中使用Monaco Editor 1.X

我可以很好地运行this sample。但我不知道如何使它与AngularJS 1.X协同工作。

例如,我要绑定ng-ifng-modelng-change到编辑器,以决定何时以及如何显示,并运行一个功能,如果有任何变化。随着ui-codemirror,我们可以用一个指令写:

<textarea ng-if="condition" ng-change="change(content)" ng-model="content" ui-codemirror="{ mode: 'application/json' }"></textarea> 

因此,没有人知道是否有这样的ui-指令摩纳哥编辑器?有没有什么解决方法可以在角度框架内实现相同的功能?

回答

0

我开始通过模仿ui-codemirror编写ui-monacoeditor。它尚未完成,但适用于我有限的使用。