title: How to call Node.js Web API from Angular JS API?
body: <p>I want to convert the whole of HTML into JADE but ((record.name}} is not working. And hence value cannot be fetched and printed. I'm posting complete files here</p>
  
  <p>Here's my directory view:</p>
  
  <p><a href="https://i.stack.imgur.com/AfOdO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AfOdO.png" alt="enter image description here"></a></p>
  
  <p>Here's my JSON file (customerList.json):</p>
  
  <pre><code>[{"name":"Rohan","add":"Sec 49, Noida"}, 
  {"name":"Sam","add":"Sec 63, Noida"},
  {"name":"Jack","add":"Sec 15, Noida"}]
  </code></pre>
  
  <p>Here is my view (index.html)</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html data-ng-app="myApp"&gt;
  
    &lt;head&gt;
      &lt;script data-require="jquery@*" data-semver="2.1.4" src="http://code.jquery.com/jquery-2.1.4.min.js"&gt;&lt;/script&gt;
      &lt;link data-require="bootstrap@*" data-semver="3.3.5" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" /&gt;
      &lt;script src="https://code.angularjs.org/1.4.0-beta.5/angular.js" data-semver="1.4.0-beta.5" data-require="angular.js@*"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="style.css" /&gt;
      &lt;script src="/js/customerController.js"&gt;&lt;/script&gt;
      &lt;script src="/js/dataService.js"&gt;&lt;/script&gt;
      &lt;script src="/json/customerList.json"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;div data-ng-controller="CustomerController as vm"&gt;
        &lt;table class="table table-striped table-hover"&gt;
          &lt;tbody&gt;
            &lt;tr data-ng-repeat="record in vm.data"&gt;
              &lt;td&gt;{{record.name}}&lt;/td&gt;
              &lt;td&gt;{{record.add}}&lt;/td&gt;
            &lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Here's my controller (customerController.js):</p>
  
  <pre><code>  (function(){
  
  var app = angular.module('myApp', []);
  
  app.controller('CustomerController', CustomerController);
  
  CustomerController.$inject = ["dataService"];
  
  function CustomerController( dataService) {
    var vm = this;
  
    activate();
  
      function activate() {
        dataService.GetData()
          .then(function(results) {
            vm.data = results;
          },
            function(error) {})
          .finally(function() {
  
          });
      }
    }
  })();
  </code></pre>
  
  <p>Here's my Service (dataService.js):</p>
  
  <pre><code> (function() {
        'use strict';
  
  
        angular.module('myApp')
          .factory('dataService', dataService);
  
        dataService.$inject = ['$q', '$timeout', '$http'];
  
        function dataService($q, $timeout, $http) {
        var data = [];
  
        console.log("Number of table entries is: " + data.length);
  
          var promise = $http.get('customerList.json');
          promise.then(function(response) {
          data = response.data;
          console.log("Number of table entries is now: " + data.length);
          });
  
          return {
            GetData: getData
          };
  
          function getData() {
  
            return $q(function(resolve, reject) {
              $timeout(function() {
                resolve(data);
              }, 3000);
  
            });
  
          }
        }
    })();
  </code></pre>
  
  <p>I've to convert this index.html into index.jade and also this should be a Node.js API with Express.js. But I've done using Angular.js. Kindly help.</p>
  
  <p>I'm getting following error: </p>
  
  <pre><code>GET http://localhost:3000/js/customerController.js 
  localhost/:1 GET http://localhost:3000/js/dataService.js 
  localhost/:1 GET http://localhost:3000/json/customerList.json 
  angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
  Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
  http://errors.angularjs.org/1.4.0-beta.5/$injector/nomod?p0=app
      at REGEX_STRING_REGEXP (https://code.angularjs.org/1.4.0-beta.5/angular.js:68:12)
      at https://code.angularjs.org/1.4.0-beta.5/angular.js:1841:17
      at ensure (https://code.angularjs.org/1.4.0-beta.5/angular.js:1765:38)
      at module (https://code.angularjs.org/1.4.0-beta.5/angular.js:1839:14)
      at https://code.angularjs.org/1.4.0-beta.5/angular.js:4172:22
      at forEach (https://code.angularjs.org/1.4.0-beta.5/angular.js:328:20)
      at loadModules (https://code.angularjs.org/1.4.0-beta.5/angular.js:4156:5)
      at createInjector (https://code.angularjs.org/1.4.0-beta.5/angular.js:4082:11)
      at doBootstrap (https://code.angularjs.org/1.4.0-beta.5/angular.js:1514:20)
      at bootstrap (https://code.angularjs.org/1.4.0-beta.5/angular.js:1535:12)
  http://errors.angularjs.org/1.4.0-beta.5/$injector/modulerr?p0=app&amp;p1=Error…0(https%3A%2F%2Fcode.angularjs.org%2F1.4.0-beta.5%2Fangular.js%3A1535%3A12)REGEX_STRING_REGEXP @ angular.js:68(anonymous function) @ angular.js:4195forEach @ angular.js:328loadModules @ angular.js:4156createInjector @ angular.js:4082doBootstrap @ angular.js:1514bootstrap @ angular.js:1535angularInit @ angular.js:1429(anonymous function) @ angular.js:27245n.Callbacks.j @ jquery-2.1.4.min.js:2n.Callbacks.k.fireWith @ jquery-2.1.4.min.js:2n.extend.ready @ jquery-2.1.4.min.js:2I @ jquery-2.1.4.min.js:2
  </code></pre>