Routing and navigation in Angular 2

前端 未结 6 1469
误落风尘
误落风尘 2020-12-06 17:45

I am going through the tutorials for Angular 2 and have been able to get a simple application up and running. Now, I am moving on to the routing and navigation part found h

6条回答
  •  庸人自扰
    2020-12-06 18:26

    Angular 2 by default uses HTML5 routing, you either have to map all server requests to index.html by adding the following to web.config

    
        
            
                
                
                    
                
                
            
        
    
    

    or implement the HashLocationStrategy, as described in angular docs here

    provide(LocationStrategy, {useClass: HashLocationStrategy})
    

提交回复
热议问题