Create custom mode of ace-editor without requireJS

1.6k views Asked by At

I want to create an angular service module can generate custom mode of ace-editor. But for creating custom mode of ace-editor, it used requireJS. I don't want to use it in my angular service module. So I wonder how to create custom mode of ace-editor without requireJS?

1

There are 1 answers

0
a user On BEST ANSWER

You need to use ace.require to get submodules from ace.define to register your mode with ace.

E.g this example http://plnkr.co/edit/HIFlsg889L4Z7dVYiV1y?p=info defines a mode without using requirejs

You can also create MyModeConstructor function in any way you want and then call ace.define("my/mode/id", [] {Mode:MyModeConstructor}) to register it.