title: Does Angular need a web server to run? So would Angular work if I give browser a url of a local file?
body: <p>By this I mean I have read that Angular allows mock up data to be used so that RESTFul apis need not be wired up.  I can think of a use case where a UX designer need only look at the cosmetics and need not hook up to a web server.  I can think of other use cases as well.</p>
  
  <p>So would Angular work is I give browser a url of a local file like C:\temp\index.html and the js files are either at c:\temp or say c:\temp\js.</p>
  
  <p>So actually, I tried it, here is all in one application file (I know it should be separated)</p>
  
  <pre><code>&lt;html ng-app="myNoteApp"&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;&lt;/script&gt;
  &lt;body&gt;
  
  &lt;div ng-controller="myNoteCtrl"&gt;
  
  &lt;h2&gt;My Note&lt;/h2&gt;
  
  &lt;p&gt;&lt;textarea ng-model="message" cols="40" rows="10"&gt;&lt;/textarea&gt;&lt;/p&gt;
  
  &lt;p&gt;
  &lt;button ng-click="save()"&gt;Save&lt;/button&gt;
  &lt;button ng-click="clear()"&gt;Clear&lt;/button&gt;
  &lt;/p&gt;
  
  &lt;p&gt;Number of characters left: &lt;span ng-bind="left()"&gt;&lt;/span&gt;&lt;/p&gt;
  
  &lt;/div&gt;
  
  &lt;script &gt;
  // was in separate file but pasted in for demo purposes
  var app = angular.module("myNoteApp", []);
  
  &lt;/script&gt;
  &lt;script &gt;
  // was in separate file but pasted in for demo purposes
  app.controller("myNoteCtrl", function($scope) {
      $scope.message = "";
      $scope.left  = function() {return 100 - $scope.message.length;};
      $scope.clear = function() {$scope.message = "";};
      $scope.save  = function() {alert("Note Saved:" + $scope.message);};
  });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The results are, it works in Chrome and Firefox no problems, IE blocks content initially but one can allow it run.</p>