title: what is the diffrence between factory and controller?
body: <p>I am developing an AngularJs app . when I search about some controller samples like firebase Auth </p>
  
  <pre><code>    .factory("Auth", function($firebaseAuth) {
           var usersRef = new Firebase("https//&lt;YOUR-FIREBASE-APP&gt;.firebaseio.com/users");
           return $firebaseAuth(usersRef);
       })
  </code></pre>
  
  <p>this will use factory instead of controller.
  I have changed it to controller and it works as well.
  I need to know about the difference. </p>