Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
Angular 2 typescript protected members in component templates

I was thinking about how could be possible implement some members in a component that could be accessed from the template but not from a parent component.

I searched for some information about the typescript visibility in angular 2 but I only found topics about "public" and "private" declarations but not about"protected".

So, does it make sense to use "protected" for this?

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

the compiler warns me if i use in the html file a property which is declared private (although it works!). If i use protected, then no warns is emitted

about 4 years ago · Santiago Trujillo Denunciar

0

some members in a component that could be accessed from the template but not from a parent component.

protected/private only make sense if you are doing component inheritance. This is now the thing you are discussing. Component composition doesn't impact your choice here.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda