Skip to content

Commit 456d4aa

Browse files
first commit
0 parents  commit 456d4aa

File tree

5 files changed

+520
-0
lines changed

5 files changed

+520
-0
lines changed

Readme.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
angular2-codemirror
2+
---------------------
3+
4+
This is a wrapper over codemirror native code, written to use in angular2 application.
5+
6+
Featuers
7+
--------
8+
1. reload editor each time on changing its configuration.
9+
2. provides a way to load required js file on-demand(lazyload). So, you have to only include codemirror.js file in index.html. You can use the feature of lazyload to set addition options.
10+
11+
12+
Setup
13+
------
14+
1. npm install codemirror --save
15+
1. write a copy task to copy the codemirror API folder in build.
16+
2. include CodeEditorModule into your module.
17+
3. Inside your template include a tag <codemirror [(ngModel)] = 'Code' id='code' name='code'></codemirror>
18+
4. In your controller set codemirror editor configuration options with addition options - mimes(Array of string), onDemandLoadJs(boolean), codemirrorAPIUrl(string).
19+
20+
Addition Options
21+
----------------
22+
1. mimes- Its value must be array of string(s). Each string denotes the mime supported for particular language.
23+
2. onDemandLoadJs- Its value must be boolean. If you want to load required js file except codemirror.js on demand then set this flag to true.
24+
3. codemirrorAPIUrl- Its value must be a string denoting the path of folder of codemirror like '/node_modules/codemirror'. It is used to load js file on demand.

0 commit comments

Comments
 (0)