user1283776
user1283776

Reputation: 21764

When talking about AngularJS, what exactly is the view?

When talking about AngularJS, what exactly is the view? Or can it be more than one thing?

Upvotes: 1

Views: 65

Answers (2)

Damjan Pavlica
Damjan Pavlica

Reputation: 33973

All your HTML pages are the view. JS files are usually controllers or services.

HTML is the user interface (the view) and JavaScript is the engine of the application, consists mainly of controllers and services (see Angular's service as a model).

enter image description here

So, the view is all the user could see.

Upvotes: 0

Khalid Hussain
Khalid Hussain

Reputation: 1694

View is what the user sees (the DOM).

Normal HTML in Angular is called template. When Angular starts your application, it parses and processes the markup from the template using the compiler. The loaded, transformed and rendered DOM is then called the view.

Have a look at the following image:

enter image description here

Source: https://docs.angularjs.org/guide/concepts#view

Upvotes: 3

Related Questions