Drop:
templates-use-publicno-access-missing-memberinvoke-injectabletemplates-use-public is being dropped?
Couldn't get that one working actually :(
What problem do you have with it?
It may of been the project I was working with (it had a boat-load of strange issues (hidden characters driving TSLint crazy I'm guessing), let me double check on a normal one!
These rules are very helpful when moving existing app to AOT compilation.
There are also useful in AngularJS applications using ng-metadata. I will not drop them in near future.
Can we disable these rules until this gets in?
Why are these being dropped? Couldn't find why, especially templates-use-public?
Because the Angular Language Service already checks that
@wKoza ng lint will output errors? I think not. I think these rules are needed
No, of course. Codelyzer delegates this task to the compiler (with AOT mode) => ng build --prod
I really don't understand this choice.
I use ng serve without the --aot flag because I want my dev environment to be as fast as possible and JIT compilation is made to achieve this purpose.
During development I also want to be informed as soon as possible if I'm writing code that won't work in production, when I will run ng build --prod. I don't want to find it out once I think I'm done but I'm actually not because I have to run ng serve --aot and then refactor the code I thought would work.
Am I missing something? I think this is a quite common use case.
Yes, it's a common use case but as I already said, the Angular Language Service checks that.
Check if you have this dependency into your package.json:
"@angular/language-service": "X.X.X"
You have to see an error in your template if you use a private member.
@wKoza Even though this is a fix to my problem, I do not fully agree with this approach:
templates-use-public (even though the mistake was made in the .ts. file) => not reliable.And there is still a problem with data types.
If we use in html template some parameter (as object property) which is not valid with assigned object type, then error occurs only when we make production build with AOT.
For example:
TS:
data: { name: string, code: number }
HTML:
<div>{{ data.id }}</div>
It's quite confusing.
Most helpful comment
I really don't understand this choice.
I use
ng servewithout the--aotflag because I want my dev environment to be as fast as possible and JIT compilation is made to achieve this purpose.During development I also want to be informed as soon as possible if I'm writing code that won't work in production, when I will run
ng build --prod. I don't want to find it out once I think I'm done but I'm actually not because I have to runng serve --aotand then refactor the code I thought would work.Am I missing something? I think this is a quite common use case.