What is a Component in Angular?

A Component is a programmable container that holds application and presentation logic. Any element on a web page can be regarded as a component. For Instance a button could be considered as a component.

In Angular, the Entry Level Component is called App Component. A Component normally contains 4 files

app.component.html

app.component.css

app.component.ts

app.component.spec.ts

Screen Shot 2018-03-08 at 4.55.45 PM.png

The Presentation Logic is written in app.component.html, The Application Logic is written in app.component.ts. Code for styling is present in the app.component.css file and the code for testing resides in the app.component.spec.ts file.

I would be discussing this in further detail in my upcoming blogs.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s