Routing an Angular 2 app with Web API

后端 未结 2 633
刺人心
刺人心 2021-02-10 14:20

I have an Angular 2 application created with Angular CLI. This has to call a .NET 4.6 Web API. The route setup of this is driving me nuts.

For Angular, the default folde

2条回答
  •  臣服心动
    2021-02-10 14:59

    You need first disable web api routing for angular files, add this to web.config, inside :

    
      
        
          
          
            
            
            
          
          
        
      
    
    

    And then, add to your index.html.

    UPD: Rewrite access to index.html

    You can add another rewrite rule to override access to your /dist/ folder:

    
        
            
                
               
            
        
    
    

提交回复
热议问题