Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/seiyria/ng2-ace

A basic ace editor directive for angular 2.
https://github.com/seiyria/ng2-ace

ace ace-editor angular2 ng2

Last synced: about 1 month ago
JSON representation

A basic ace editor directive for angular 2.

Awesome Lists containing this project

README

        

# ng2-ace
A basic ace editor directive for angular 2.

# Install
`npm i -s ng2-ace`

# Sample Usage

```js
import { Component } from 'angular2/core';

import { AceEditorDirective } from 'ng2-ace';

import 'brace/theme/clouds';
import 'brace/mode/sql';

@Component({
directives: [AceEditorDirective],
template: `


`
})
export class MyComponent {
constructor() {
this.text = 'test';
this.options = { printMargin: false };
this.onChange = (data) => {
console.log(data);
}
}
}
```
Important pieces to note in the HTML template: `[ace-editor]` attribute, `[text]`, `[theme]`, `[mode]`, `[readOnly]`, `[options]` inputs, `(textChanged)` output. As per Ace, you must also make it a `display: block;` and give it a width and height.