title: AngularJS Routing with Web.API Visual studio project
body: <p>I have a problem introducing the routing in a webapi project, created in VS2017. I use the lastest vesion of angular. This is the source:</p>
  
  <p>app.angular</p>
  
  <pre><code>angular.module('angularapp', [
  'ngRoute',
  'ngCookies',
  'ngAnimate',
  'angular-loading-bar'
  </code></pre>
  
  <p>])</p>
  
  <pre><code>.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
  
      $routeProvider.when('/login', {
              templateUrl: 'login.aspx'
      })
  
          .when('/', {
              templateUrl: '/login.aspx'
          })
  
          .when('/404', {
              templateUrl: '/404.aspx'
          })
  
          .when('/home', {
              templateUrl: '/home.aspx'
          })       
  
          .otherwise({ redirectTo: '/' });
  
      $locationProvider.html5Mode({
          enabled: true,
          requireBase: false
      });
  }])
  </code></pre>
  
  <p>On project launch, IIS result is 404. Obviusly, I loaded angular, then ngroute, then the controllers. There is a master page where I load globally all css and js on all the other page are aspx. Each page have a controller. I am missing something o there are some errors in the files? Need other info?
  Thanks for help</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Code over modify.
  I modify the web.confing in this way:</p>
  
  <pre><code>&lt;system.webServer&gt;
  &lt;validation validateIntegratedModeConfiguration="false" /&gt;
  &lt;modules&gt;&lt;/modules&gt;
  &lt;handlers&gt;
    &lt;remove name="ExtensionlessUrlHandler-Integrated-4.0" /&gt;
    &lt;remove name="OPTIONSVerbHandler" /&gt;
    &lt;remove name="TRACEVerbHandler" /&gt;
    &lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /&gt;
  &lt;/handlers&gt;
  &lt;rewrite&gt;
    &lt;rules&gt;
      &lt;rule name="AngularJS Routes" stopProcessing="true"&gt;
        &lt;match url=".*" /&gt;
        &lt;conditions logicalGrouping="MatchAll"&gt;
          &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
          &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
          &lt;add input="{REQUEST_URI}" pattern="api/(.*)" negate="true" /&gt;
        &lt;/conditions&gt;
        &lt;action type="Rewrite" url="/" /&gt;
      &lt;/rule&gt;
    &lt;/rules&gt;
  &lt;/rewrite&gt;
  &lt;defaultDocument&gt;
    &lt;files&gt;
      &lt;clear /&gt;
      &lt;add value="login.aspx"/&gt;
    &lt;/files&gt;
  &lt;/defaultDocument&gt;
  </code></pre>
  
  <p></p>
  
  <p>Login now is loading, but I have a problem with injection module... I don't know where. If I login correctly, IIS reload always login.</p>