Recently diving into the world of angular2+ and ace development, I encountered an issue while trying to embed the ace editor within my angular application. The error message "ace is not defined" kept popping up, causing some frustration.
Operating on ubuntu gnome 16.04 system, here are the steps that I took: 1. Installed ace-builds through npm 2. Updated the path in angular-cli.json by including the ace.js from src-min-noconflict folder 3. Created an editor component with the following code snippet in editor.component.ts:
declare const ace:any;
@Component({....})
export class EditorComponent implements OnInit {
editor:any;
......
ngOnInit() {
this.editor = ace.edit("editor");
}
}
The console indicated that the error occurred at the line "this.editor =....."
I experimented with different versions of ace, but unfortunately, none seemed to work. If anyone has a solution or suggestion on how to resolve this issue, I would greatly appreciate your help!