title: require is not defined in angular
body: <p>I am using angularjs where i have created a js file(loginCtrl.js) and i have inclused a controller.
  I have defined my db connection and schema in another file(server.js) and i want to include that file in my js.</p>
  
  <p>My loginCtrl.js looks like:</p>
  
  <pre><code>test.controller('loginCtrl', function($scope, loginService){
  
     $scope.login = function(user)
     {
         console.log('inside function 1');
         var user = require('./server.js')
        console.log('inside function');
         loginService.login(user);
     }
  
  });
  </code></pre>
  
  <p>and my server.js files looks like:</p>
  
  <pre><code>var express = require('express');
  var mongoose = require('mongoose');
  
  mongoose.connect('mongodb://localhost/userregistration');
  
  var userSchema = {
      username: String,
      firstname:String,
      lastname: String,
      email: String,
      password: String
  }
  
  var User = mongoose.model('User', userSchema, 'user');
  </code></pre>
  
  <p>When i run the code, it gives the error like:</p>
  
  <pre><code>ReferenceError: require is not defined
  </code></pre>
  
  <p>It is printing the console.log defined above.</p>