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";
}
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";
}