ng-helper enhances the efficiency of Angular.js development, especially when used with TypeScript. It provides convenient features such as auto-completion for ng-* directives and data binding in HTML, hover type hints, injection validation in ts files, right-click context menu for creating components, and more.
ng-*
directive auto-completion (see demo)TypeScript
): auto-completion, hover type hints, go to definition (see demo)TypeScript
codeJavaScript
codeUseful utilities features:
ng-helper.json
file in the .vscode
directory of your workspace(This file is a plugin startup flag, without which the plugin will not start)Create an empty ng-helper.json
file in the .vscode
directory of your workspace. It supports the following configuration:
componentStyleFileExt
: The suffix for the style file when creating a component, such as less
, sass
, etc. The default value is css
.componentScriptFileExt
: js
or ts
. The default value is js
.injectionCheckMode
: The modes for dependency injection check include strict_equal
, ignore_case_word_match
, count_match
, and off
, with constraints ranging from strict to none. The default value is count_match
.When using feature like auto-completion in the html template, it may not work if no ts/js file has been opened for preview after the project is opened. This can cause the TypeScript language service to not start, resulting in no auto-completion. In this case, an warning message will pop up in the lower right corner. Click OK, and a ts/js file will automatically open. After that, return to the HTML file, and the auto-completion should work normally.