如何使用 angular-ui-ace 在编辑器中添加自动完成选项
how add autocomplete option in editor using angular-ui-ace
我正在使用 aungular-ui-ace 在我的网站上创建一个代码编辑器。一切都很好,但我想要包括自动完成选项。 {enableBasicAutocompletion: true} 选项对我不起作用。
我的代码:
var app = angular.module('MyApp', ['ui.ace']);
app.controller('MyCtrl', function($scope){});
<head>
<script src="/bower_components/angular/angular.js"></script>
<script type="text/javascript" src="/bower_components/ace-builds/src-min-noconflict/ace.js"></script>
<script type="text/javascript" src="/bower_components/angular-ui-ace/ui-ace.js"></script>
</head>
<body ng-app="MyApp" ng-controller="MyCtrl">
<div ui-ace="{mode: 'javascript', enableBasicAutocompletion: true}"></div>
</body>
请参阅自述文件的高级选项部分 https://github.com/angular-ui/ui-ace#advanced-options
var app = angular.module('MyApp', ['ui.ace']);
app.controller('MyCtrl', function($scope){});
<head>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-beta.1/angular.js"></script>-->
<script src="http://angular-ui.github.io/ui-ace/assets/vendor/angular.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ext-language_tools.js"></script>
<script type="text/javascript" src="http://angular-ui.github.io/ui-ace/dist/ui-ace.js"></script>
</head>
<style>
.ace_editor {
height : 200px;
}
</style>
<body ng-app="MyApp" ng-controller="MyCtrl">
<div ui-ace="{mode: 'javascript',
require: ['ace/ext/language_tools'],
advanced: {
enableSnippets: true,
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
}}"></div>
</body>
我正在使用 aungular-ui-ace 在我的网站上创建一个代码编辑器。一切都很好,但我想要包括自动完成选项。 {enableBasicAutocompletion: true} 选项对我不起作用。
我的代码:
var app = angular.module('MyApp', ['ui.ace']);
app.controller('MyCtrl', function($scope){});
<head>
<script src="/bower_components/angular/angular.js"></script>
<script type="text/javascript" src="/bower_components/ace-builds/src-min-noconflict/ace.js"></script>
<script type="text/javascript" src="/bower_components/angular-ui-ace/ui-ace.js"></script>
</head>
<body ng-app="MyApp" ng-controller="MyCtrl">
<div ui-ace="{mode: 'javascript', enableBasicAutocompletion: true}"></div>
</body>
请参阅自述文件的高级选项部分 https://github.com/angular-ui/ui-ace#advanced-options
var app = angular.module('MyApp', ['ui.ace']);
app.controller('MyCtrl', function($scope){});
<head>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-beta.1/angular.js"></script>-->
<script src="http://angular-ui.github.io/ui-ace/assets/vendor/angular.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ext-language_tools.js"></script>
<script type="text/javascript" src="http://angular-ui.github.io/ui-ace/dist/ui-ace.js"></script>
</head>
<style>
.ace_editor {
height : 200px;
}
</style>
<body ng-app="MyApp" ng-controller="MyCtrl">
<div ui-ace="{mode: 'javascript',
require: ['ace/ext/language_tools'],
advanced: {
enableSnippets: true,
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
}}"></div>
</body>