Skip to content

Commit

Permalink
release v1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
giscafer committed Jun 28, 2019
1 parent 480d1fe commit 7f01391
Show file tree
Hide file tree
Showing 365 changed files with 170 additions and 332,533 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ node_modules
# Optional REPL history
.node_repl_history
dist
package-lock.json
package-lock.json
.ng_pkg_build
7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ build/Release

# Dependency directory
node_modules

docs
demo
ace-builds
# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
package-lock.json
package-lock.json
.ng_pkg_build/*
50 changes: 23 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# ng-ace-tern
# ngx-ace-tern

[![npm package](https://img.shields.io/npm/v/ng-ace-tern.svg)](https://www.npmjs.org/package/ng-ace-tern)
[![npm package](https://img.shields.io/npm/v/ngx-ace-tern.svg)](https://www.npmjs.org/package/ngx-ace-tern)

Tern plugin for Ace Editor, suport angular2\angular4\agnular5.

[Online Demo](http://giscafer.github.io/ng-ace-tern/)
Tern plugin for Ace Editor, base on Angular8.x.

[Online Demo](http://giscafer.github.io/ngx-ace-tern/)

default options

Expand All @@ -18,62 +17,59 @@ default mode: `javascript`

default theme: `chrome`


# Install

`npm i ng-ace-tern`


`npm i ngx-ace-tern`

## Sample Usage

add scripts `ace-builds` in your `index.html` or `angular-cli.json`

eg:
eg:

```html
<script src="./assets/ace-builds/src-noconflict/ace.js"></script>
<script src="./assets/ace-builds/src-noconflict/ace.js"></script>
```



```ts
import { Component } from '@angular/core';

import { AceEditorDirective } from 'ng-ace-tern';
import { AceEditorDirective } from 'ngx-ace-tern';

@Component({
directives: [AceEditorDirective],
template: `
<div ace-editor
[text]="text"
[mode]="'sql'"
[theme]="'clouds'"
[options]="options"
[readOnly]="false"
(textChanged)="onChange($event)"
style="display:block; height: 80vh; width:100%"></div>
<div
ace-editor
[text]="text"
[mode]="'sql'"
[theme]="'clouds'"
[options]="options"
[readOnly]="false"
(textChanged)="onChange($event)"
style="display:block; height: 80vh; width:100%"
></div>
`
})
export class MyComponent {
constructor() {
this.text = 'test';
this.options = { printMargin: false };
this.onChange = (data) => {
this.onChange = data => {
console.log(data);
}
};
}
}
```
Important pieces to note in the HTML template: `[ace-editor]` attribute, `[text]`, `[theme]`, `[mode]`, `[readOnly]`, `[options]` inputs, `(textChanged)` ,`(editorRef)` output. As per Ace, you must also make it a `display: block;` and give it a width and height.

Important pieces to note in the HTML template: `[ace-editor]` attribute, `[text]`, `[theme]`, `[mode]`, `[readOnly]`, `[options]` inputs, `(textChanged)` ,`(editorRef)` output. As per Ace, you must also make it a `display: block;` and give it a width and height.

## Related

- [ng-ace](https://github.com/giscafer/ng-ace)
- [Ace.Tern](https://github.com/sevin7676/Ace.Tern)

# License
# License

MIT

Expand All @@ -82,4 +78,4 @@ MIT
> [giscafer.com](http://giscafer.com) &nbsp;&middot;&nbsp;
> GitHub [@giscafer](https://github.com/giscafer) &nbsp;&middot;&nbsp;
> Twitter [@nickbinglao](https://twitter.com/nickbinglao) &nbsp;&middot;&nbsp;
> Weibo [@Nickbing_Lao](https://weibo.com/laohoubin)
> Weibo [@Nickbing_Lao](https://weibo.com/laohoubin)
Loading

0 comments on commit 7f01391

Please sign in to comment.