In the 4th day of AngularJS article series, we are going to learn next concept of AngularJS, that is understanding the concept of Views in AngularJS.
Before moving to key players/concepts of AngularJS, please read my previous articles:
- Introduction to AngularJS – Day 1
- Introduction to AngularJS – Day 2
- Introduction to AngularJS – Day 3
Views
View is nothing but what user sees means user interface (UI).

View is HTML template, it render the user interface. It contains HTML and CSS and binds data or property defined in controller using the $scope object. $scope is nothing but bridge between the view and controller it helps to bind the controller properties. It uses directives to enhance HTML and render data to the view.
The following example illustrate how HTML uses directives to render data to the view,
- <div ng-controller="viewController">
- <h1>Welcome to C# Corner!</h1>
- <h3>List of Employees</h3>
- <ul ng-repeat="emp in employees">
- <li>{{ emp }}</li>
- </ul>
- </div>
The full code of example is here:
- <!DOCTYPE html>
- <html ng-app="myApp">
- <head>
- <title>Views in AngularJS</title>
- <script src="Scripts/angular.min.js"></script>
- </head>
- <body>
- <div ng-controller="viewController">
- <h1>Welcome to C# Corner!</h1>
- <h3>List Of Employees</h3>
- <ul ng-repeat="emp in employees">
- <li>{{ emp }}</li>
- </ul>
- </div>
- <script type="text/javascript">
- //Creating Module
- var app = angular.module("myApp", []);
- //Creating Controller using object of module 'app'
- app.controller("viewController", function ($scope) {
- $scope.employees = [
- 'Varsha Chaudhari', 'Sameer Rajigare', 'Makarand Borawake',
- 'Paritosh M', 'Prasad Kulkarni', 'Monika Kamble', 'Reshu B'
- ];
- });
- </script>
- </body>
- </html>

Great, your Views in AngularJS example created successfully!
Summary
I hope that beginners as well as students understood the concept of Views in AngularJS with example. If you have any suggestion regarding this article, then please contact me. Stay tuned for other concepts of AngularJS coming soon!
Thanks for reading. Learn it! Share it!

Vivek KumarPosted Apr 22, 2016, 11:44 AM
Good one.
Santhakumar MunuswamyPosted Dec 22, 2015, 10:54 AM
Thanks for nice share
Pankaj BajajPosted Dec 19, 2015, 8:10 AM
gud one jeet
Ajay GandhiPosted Dec 19, 2015, 5:56 AM
Nice and Thank you