Você está na página 1de 10

ANGULARJS

INTRODUCTION

What is Angular JS ?
AngularJS

is a part of this new generation of


libraries and frameworks that came to
support the development of more productive,
flexible, maintainable, and testable
web applications.

Introduction

Declarative programming is the best choice to construct


the user interface.

AngularJS empowers traditional HTML by extending its current


vocabulary, making the life of developers easier.

Imperative programming is much better and preferred to


implement an application's business logic.

Architectural concepts

For Angular apps, we encourage the use of


the Model-View-Controller (MVC) design patternto decouple the
code and to separate concerns.

After a lot of discussions about which architectural pattern the


framework follows, its authors declared that from now on,
AngularJS would adopt Model-ViewWhatever (MVW).

Regardless of the name, the most important benefit is that the


framework provides a clear separation of the concerns between
the application layers, providing modularity, flexibility, and
testability.

The view

It is also called template, is entirely written in HTML

It also takes advantage of the directives mechanism, which is a


type of extension of the HTML

The controller

Behind the view, there is the controller. At fist, the controller


contains all the business logic implementation used by the view.
However, as the application grows, it becomes really important
to perform some refactoring activities, such as moving the code
from the controller to other components (for example, services)
in order to keep the cohesion high.

The connection between the view and the controller is done by a


shared object
called scope. It is located between them and is used to exchange
information
related to the model.

The model
The

model is a simple Plain-Old-JavaScriptObject (POJO).

But

AngularJS allow us to create rich model


data.

Directives
A

directive is an extension of the HTML


vocabulary that allows us to create new
behaviors.

Directives

The following diagram describes the bootstrapping process of the


framework that is performed during the compilation process

Using AngularJS built-in


directives

ngApp

ngController

ngBind

ngRepeat

ngModel

ngClick

ngDisabled

ngClass

ngShow & ngHide

ngIf

Você também pode gostar