Tuesday, August 8, 2017

explicitly public

In Angular 4, there seems to be a trend away from making variables explicitly public in components in favor of just leaving the accessibility modifier off of public variables that are in components yet outside of component methods as these will nonetheless be public. You do have to use the public keyword (or the private keyword) when declaring a variable at the signature of a constructor if you want the variable to be accessible beyond the constructor itself.

No comments:

Post a Comment