What is controller?


in my first app angular help me to get title from main controller , but what is the controller ?


In a nutshell, the controller is where we get the data for the session. The controller puts the data in the same scope as our app instance.


so i can define variables in controller and save some data, and call it in view


So long as you maintain the data structure and syntax, yes.

<div class="main" ng-controller="MainController">

It’s because of the data connection (scope) that we can display the container in desired fashion.


thank you too much :smiley:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.