What is controller?


#1

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


#2

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.


#3

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


#4

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.


#5

thank you too much :smiley:


#6

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