修改Angular路由模式为hash模式
 
                    spa 应用一般有html5 history模式和hash模式,angular 默认是 history 模式,修改为hash 的方法:
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}],
重新运行项目即可
版权声明:
                                    
作者:东明兄                                    
链接:https://blog.crazyming.com/note/748/
                                    
来源:CrazyMing                                    
文章版权归作者所有,未经允许请勿转载。
                                
                        THE END
                    
                    
                    
                        二维码        
                
                        海报        
        
            
            修改Angular路由模式为hash模式
            
                spa 应用一般有html5 history模式和hash模式,angular 默认是 history 模式,修改为hash 的方法:
import {HashLocationStrategy, LocationStrategy} from '@a……            
             
                 
                     
         
             
            
共有 0 条评论