Book Image

Getting Started with Angular - Second edition - Second Edition

By : Minko Gechev
Book Image

Getting Started with Angular - Second edition - Second Edition

By: Minko Gechev

Overview of this book

Want to build quick and robust web applications with Angular? This book is the quickest way to get to grips with Angular and take advantage of all its new features.
Table of Contents (16 chapters)
Getting Started with Angular Second Edition
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Getting to know Angular components


Model View Controller (MVC) is a micro-architectural pattern initially introduced for the implementation of user interfaces. As Angular developers, we use different variations of this pattern on a daily basis, most often Model View ViewModel (MVVM). In MVC, we have the model, which encapsulates the business logic of our application, and the view, which is responsible for rendering the user interface, accepting user input, and delegating the user interaction logic to the controller. The view is represented as composition of components, which is formally known as the composite design pattern.

Let's take a look at the following structural diagram, which shows the composite design pattern:

Figure 5

Here, we have three classes:

  • An abstract class called Component.

  • Two concrete classes called Leaf and Composite. The Leaf class is a simple terminal component in the component tree that we will build soon.

The Component class defines an abstract operation called operation...