DEV Community

Cover image for Angular : Components
JWP
JWP

Posted on • Edited on

1

Angular : Components

Why Components?

The demand for more and more features within Web applications is increasing exponentially. This means that to keep up with the demand we must focus on an "assembly" line approach to software creation.

Each station in an assembly line adds another component to the product; where, each component is sourced independently from other components. Each component is only responsible for one thing,n works flawlessly and just snaps into the overall product.

This is how we want to train ourselves in Angular design; lots of Small parts that have these features.

1) Each component will do only one thing.
2) Each component will work every time, in the same way.
3) Each component will be completely isolated unto itself.

Angular's CLI (command line interface) makes creating components super easy. In Visual Studio code click on Terminal. In the Terminal Session (usually a PowerShell session).

To Create a Component, Simply type in

'ng g component componentName'

A new component shows up in the current directory and you are ready to start creating small parts.

Follow the 3 suggestions above and you are well on your way to creating very good applications!

Top comments (0)

11 Tips That Make You a Better Typescript Programmer

typescript

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay