Thursday, August 11, 2016

MVC architecture in Angular JS

<script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</script>
<script type="text/javascript">
//Creating controller here
function Customer($scope)
{
    //Creating model here
    $scope.customer =  {
         'Name'    :   'Peakfinders',
         'Address' :   'India',
         'Email'   :   'Peakfinders@gmail.com'
     }
}
</script>
<p>Displing model data in view through controller</p>
<div ng-controller="Customer">
<h3>{{ customer.Name }} </h3>
<h3>{{ customer.Address }} </h3>
<h3>{{ customer.Email }} </h3>
</div> 

No comments:

Post a Comment