title: Angular Route for sub folder gives error
body: <p>I have written 2 <code>ng-app</code> in one project, one is <code>user</code> and the other <code>admin</code>.
  To remove the <code>#</code> from the url I had used the below code in both app.config function</p>
  
  <pre><code>$locationProvider.html5Mode(true);
  </code></pre>
  
  <p>and in app/index.html</p>
  
  <pre><code>&lt;base href="/"&gt;
  </code></pre>
  
  <p>and in app/admin/index.html</p>
  
  <pre><code>&lt;base href="/admin/"&gt;
  </code></pre>
  
  <hr>
  
  <p>user app.js</p>
  
  <pre><code>app.config(['$routeProvider','$locationProvider',
      function($routeProvider, $locationProvider) {
          $routeProvider.
          when('/properties', {
              templateUrl: 'views/modules/properties.html'
          })
          .when('/pages', {
              templateUrl: 'views/pages/pages.html'
          })
          .when('pages/editpages', {
              templateUrl: 'views/pages/editPages.html',
              controller: 'editPagesController',
          });
  
          $locationProvider.html5Mode(true);
      }
  ]);
  </code></pre>
  
  <p>server.js</p>
  
  <pre><code>app.use('/', express.static('app', { redirect: false }));
  
  app.get('/*', function(req, res){
      res.sendFile(__dirname + '/app/index.html');
  });
  </code></pre>
  
  <p>I'm getting the following error, if there's an extra param in the route</p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Unexpected token &lt;</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/611ke.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/611ke.png" alt="enter image description here"></a></p>
  
  <p>The above error I get when my urls are</p>
  
  <pre><code>http://localhost:8080/properties/
  http://localhost:8080/properties/something
  http://localhost:8080/pages/
  http://localhost:8080/pages/editpages   
  </code></pre>
  
  <p>This works fine if the url is used without the last <code>/</code> i.e.</p>
  
  <pre><code>http://localhost:8080/properties
  http://localhost:8080/pages
  </code></pre>
  
  <p>I have refered to this questions too but couldn't resolve the issue</p>
  
  <p><a href="https://stackoverflow.com/questions/31495743/node-angular-app-uncaught-syntaxerror-unexpected-token">Node / Angular app Uncaught SyntaxError: Unexpected token &lt;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/37667954/how-to-use-multiple-index-pages-in-angular">How to use multiple index pages in angular</a></p>