Thursday, 18 December 2014

Controller in AngularJS

Conroller in AngularJS :-The controller is responsible for construction of the model and connects it to the view.
Controller should be straight forward and simply contain the business logic needed for a view.

There are many ways to define a controller in Angular js.

Examples are as follows:

<div ng-controller="myCtrl">
<p>{{name}}</p>
</div>


function myCtrl($scope)
{
   $scope.name="vikash Angular Solution";
}