title: angularjs window is not defined
body: <p>Everytime I try to run my Node Express Project in eclipse IDE I get following error, I've installed angular using npm in Eclipse yet it is giving me this error</p>
  
  <p>Here is what I have so far:</p>
  
  <p>Angularapp.html</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app = "AngularApp"&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"&gt;&lt;/script&gt;
  &lt;title&gt;Login&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Login&lt;/h1&gt;
      &lt;h2&gt;Welcome!&lt;/h2&gt;
      &lt;div ng-controller="AngularController"&gt;
          Username: &lt;input type="text" ng-model="usrname" value="1" /&gt; &lt;br /&gt;
          Password: &lt;input type="text" ng-model="password" value="2" /&gt; &lt;br /&gt;
          &lt;div&gt;
              &lt;br /&gt;
              &lt;button type="button" ng-model="login" ng-click="signIn()"&gt;Login&lt;/button&gt;
          &lt;/div&gt;
  
          &lt;script src="./routes/AngularApp.js"&gt;&lt;/script&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>AngularApp.js</p>
  
  <pre><code>var usrname, paswd;
  var AngularApp = angular.module('AngularApp', []);
  
  function AngularController($scope, $http, $location, $window) {
      $scope.signIn = function() {
          usrname = $scope.usrname;
          paswd = $scope.password;
          var req = {
              method : 'POST',
              url : 'http://localhost:2222/login',
              data : {
                  "username" : usrname,
                  "password" : paswd
              }
          }
  
          $http(req).success(function(response) {
              //alert(JSON.stringify(response));
              if (response.login === "Success") {
                  $window.location = '/successLogin/'+response.username;
                  //req.url = '/successLogin/'+response.username;
              } else {
                  $window.location = '/failLogin';
                  //req.url = '/failLogin';
              }   
          }).error(function(error) {
              alert("Error");
          });
      };
  }
  
  AngularApp.controller('AngularController', AngularController);
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express')
    , routes = require('./routes')
    , user = require('./routes/user')
    , http = require('http')
    , path = require('path');
  
  var app = express();
  
  // all environments
  app.set('port', process.env.PORT || 3000);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
  
  // development only
  if ('development' == app.get('env')) {
    app.use(express.errorHandler());
  }
  
  app.get('/', routes.index);
  app.get('/users', user.list);
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log('Express server listening on port ' + app.get('port'));
  });
  </code></pre>
  
  <h2>Here is the error</h2>
  
  <pre><code>node_modules/angular/angular.js:26179
  })(window, document);
     ^
  ReferenceError: window is not defined
      at Object.&lt;anonymous&gt; (/Developer IDE/Projects/Node.JS/AngularTest/node_modules/angular/angular.js:26179:4)
      at Module._compile (module.js:460:26)
      at Object.Module._extensions..js (module.js:478:10)
      at Module.load (module.js:355:32)
      at Function.Module._load (module.js:310:12)
      at Module.require (module.js:365:17)
      at require (module.js:384:17)
      at Object.&lt;anonymous&gt; (/Developer IDE/Projects/Node.JS/AngularTest/node_modules/angular/index.js:1:63)
      at Module._compile (module.js:460:26)
      at Object.Module._extensions..js (module.js:478:10)
  </code></pre>
  
  <p>Can someone help me solve it</p>