TSLint - you can only bind to public members of the class (patterns-use-public)

I am having problems with this rule (patterns-use-public) and WebStorm. You can see it here:

enter image description here

What is the main purpose of this rule? What's wrong?

+5
source share
1 answer

This rule applies to access to private components of a component from a template. Private members are for class use only; Templates run outside the scope of the component, so they should not have access to private individuals. See https://groups.google.com/forum/#!msg/angular/D_O_1fqA9WQ/pRNQARRiBgAJ , https://github.com/devoto13/angular2-private-members-example .

Regarding highlighting, it seems that incorrect error positions are reported using the encoder. Please run tslint in terminal using ng lint - what is the result?

+6
source

Source: https://habr.com/ru/post/1262711/


All Articles