TSLint - 你只能绑定到 public class 成员 (templates-use-public)
TSLint - You can bind only to public class members (templates-use-public)
我在使用此规则 (templates-use-public) 和 WebStorm 时遇到了一些麻烦。你可以在这里看到它:
这条规则的主要目的是什么?怎么了?
此规则是关于从模板访问组件的私有成员。私有成员仅用于 class 本身;模板在组件范围之外执行,因此它们不应该访问私有对象。请参阅 https://groups.google.com/forum/#!msg/angular/D_O_1fqA9WQ/pRNQARRiBgAJ, https://github.com/devoto13/angular2-private-members-example。
至于突出显示,似乎是codelizer报告了不正确的错误位置。请 运行 在终端中使用 ng lint
tslint - 结果是什么?
我在使用此规则 (templates-use-public) 和 WebStorm 时遇到了一些麻烦。你可以在这里看到它:
这条规则的主要目的是什么?怎么了?
此规则是关于从模板访问组件的私有成员。私有成员仅用于 class 本身;模板在组件范围之外执行,因此它们不应该访问私有对象。请参阅 https://groups.google.com/forum/#!msg/angular/D_O_1fqA9WQ/pRNQARRiBgAJ, https://github.com/devoto13/angular2-private-members-example。
至于突出显示,似乎是codelizer报告了不正确的错误位置。请 运行 在终端中使用 ng lint
tslint - 结果是什么?