在 Microsoft VS Code 中,当我关闭 HTML 标记(例如在底部图像上)时,当前位置将移动到第一列并删除制表符缩进。然后我需要再次使用制表符手动缩进。我该如何解决?

我的 settings.json 文件:
... “editor.detectIndentation”:假, "editor.wrappingIndent": "无", “editor.trimAutoWhitespace”:假, “files.trimTrailingWhitespace”:假, “files.insertFinalNewline”:真, “html.format.endWithNewline”:假, ...
ngOnChanges()每当this.test组件生命周期或模板中的变量发生更改但我无法正常工作时,我都试图在Angular 5.x组件中调用函数,但该ngOnChanges()函数始终未调用。有人可以帮我吗?
src / app.ts:
import {Component, NgModule, Input, OnChanges, SimpleChanges} from '@angular/core'
import {BrowserModule} from '@angular/platform-browser'
@Component({
selector: 'my-app',
template: `
<div>
<input type="text" placeholder="Test field" value="{{ test }}">
</div>
`,
})
export class App implements OnChanges {
@Input() test: string;
name: string;
constructor() {
}
ngOnChanges(changes: SimpleChanges) {
console.log('ngOnChanges');
if (changes.test && !changes.test.isFirstChange()) {
// exteranl API call or more preprocessing...
}
for (let propName in changes) {
let change = changes[propName];
console.dir(change); …Run Code Online (Sandbox Code Playgroud) angular ×1
html ×1
indentation ×1
javascript ×1
newline ×1
ngonchanges ×1
tags ×1
typescript ×1