Angular js Controller
In this part we will discuss about , how to define model , view and controller in Angular.
As you know that every angular js app starts with the directive ng-app. In the ng-app, we define the controller for the
app that will control the app.
1)Angular Js CONTROLLER:
Controllers are basically used to control the data in the angular js app. We use ng-controller to implement the controller
in the ng-app;
We use the script tags in order to write the controller functionality.
The above step declares the name of the controller using the ng-controller directive.
The main controller code is written below
The mylatestapp is defined in the div, and it declares the name of the controller that will control the data inside the
app. The “newcontroller” is the actual controller , that we define in script tag and will control its functionality.
the same in angular js also.
In the controller we can define our functions and those functions will be used to control the data.
305total visits,1visits today