Let’s understand the Angular components!

Photo by Iker Urteaga on Unsplash
  • Components, Components consists of
  • HTML template, CSS styling, and javascript logic to work with DOM.
  • login_form component will have HTML(consists of form tag), CSS for styling specificity of form say, and some validation in JS say.
  1. login.component.html
  2. login.component.specs.ts
  3. login.components.ts
Typical structure of angular component
  • selector: ‘.app-login’: which means <div class=”app-login”></div> will be used to render this component. this is class selector
  • selector:’[app-login]’: means <div app-login></div> will be used to render this component, were app-login is custom attribute.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store