bing
Flat 10% & upto 40% off + Free additional Courses. Hurry up!
×
UPTO
50%
OFF!

MVC in AngularJS

 

mvc

AngularJS designs the applications in MVC style. MVC is an important concept of this technology, hence it is imperative to have familiarity with it. MVC stands for Model View Controller. Let’s find out what is it:

  • Model – A model in AngularJS is a primitive data type such as number, string, boolean, object, etc. It is a simple JavaScript object without any getter and setter methods.
  • View – In AngularJS Document Object Model (DOM) is the what users see. In order to display the data from controller, Angular expressions can be added to the view which will coordinate model and view about any modification.
  • Controller – Controller is a collection of JavaScript classes where application logic is defined. Model resides inside this controller.

Combine model view controller in one application like as follows :

<html ng-app>
<body ng-controller="TextController">
<p>{{msg}}</p>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js">
</script>
<script>
function TextController($scope) {
$scope.msg = 'Hello Intellipaat';
}
</script>
</body>
</html>

Output

Hello Intellipaat

So, the model is the data, the view is the User Interface and the controller is the business logic.

 

"0 Responses on MVC in AngularJS"

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.
top

Sales Offer

  • To avail this offer, enroll before 12th December 2017.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer
offer banner Black friday

Sign Up or Login to view the Free MVC in AngularJS.