https://stackoverflow.com/questions/35284988/angular-2-404-error-occur-when-i-refresh-through-the-browser

#前端#

修改app.module.ts

import { HashLocationStrategy, LocationStrategy } from '@angular/common';

providers: [
  { provide: LocationStrategy, useClass: HashLocationStrategy }
],

修改root-routing.module.ts

imports: [RouterModule.forRoot(routes, { useHash: true })],

Angular 2: 404 error occur when I refresh through the browser [duplicate]的更多相关文章

  1. angular.js:13920 Error: [$injector:unpr] Unknown provider: $scopeProvider <- $scope <- testServe

    angular.js:13920 Error: [$injector:unpr] Unknown provider: $scopeProvider <- $scope <- testSer ...

  2. How to create your own custom 404 error page and handle redirect in SharePoint 分类: Sharepoint 2015-07-08 00:22 4人阅读 评论(0) 收藏

    1. In your MOSS server, make a copy of %systemdrive%\Program Files\Common Files\Microsoft Shared\Web ...

  3. Handling HTTP 404 Error in ASP.NET Web API

            Introduction: Building modern HTTP/RESTful/RPC services has become very easy with the new AS ...

  4. Posting data to a HttpHandler greater then ~29MB gives a 404 error

    1down votefavorite 1 I am testing a HttpHandler that accepts XML. It works fine when a small amount ...

  5. Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}

    Server response error code:404, error:{"ret":-1, "msg":"invalid appkey" ...

  6. [DUBBO] Unexpected error occur at send statistic, cause: Forbid consumer 192.168.3.151 access servic

    [DUBBO] Unexpected error occur at send statistic, cause: Forbid consumer 192.168.3.151 access servic ...

  7. Win10上启动UICrawler自动遍历时报 "org.openqa.selenium.WebDriverException: An unknown server-side error occur red while processing the command. Original error: Could not sign with default certifi cate."

    操作步骤: 1.直接启动 Appium (我用的是 version 1.10.0) 2.打开命令窗口,切换到 UICrawler 所在路径 3.执行命令 java -jar UICrawler-2.2 ...

  8. Openning SharePoint - 80 website gives HTTP 404 Error, The webpage cannot be found ! on SharePoint 2013

    ask: I tried to open the SharePoint - 80 throw Browse in IIS, but I get HTTP 404 Error (The webpage ...

  9. 404 error on preview ... "buffer_id(29) is not valid (closed or unsupported file format)"

    利用sublime text2的插件OmniMarkupPreview进行md文件预览时,出现如下错误 "Error: 404 Not Found Sorry, the requested ...

随机推荐

  1. 【HDU4966】GGS-DDU

    题意 有n种科目,每个科目都有一个最高的等级a[i].开始的时候,每个科目的等级都是0.现在要选择一些课程进行学习使得每一个科目都达到最高等级.这里有m节课可供选择.对于每门课给出L1[i],c[i] ...

  2. uva1619

    分析:这个题的关键是要找到,当某个值是最小值时它最大的影响区间时什么.可以通过单调队列(单调栈)在nlogn的时间内实现 #include <cstdio> #include <cs ...

  3. SaeStorage使用示例

    新浪SAE官方地址:http://apidoc.sinaapp.com/sae/SaeStorage.html SaeStorage的代码详细:http://apidoc.sinaapp.com/__ ...

  4. 661. Image Smoother色阶中和器

    [抄题]: Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoo ...

  5. ROS indigo Ubuntu14.04 安装问题

    错误信息:Unpacking ros-indigo-desktop-full (1.1.6-0trusty-20181006-135515-0800) ... Errors were encounte ...

  6. javascript DES加密

    研究联通wifi登陆中,发现了一个名为"encryption.js"的文件.这个文件一看即知是加密过的,首先自己尝试去手工解密,看到太烦琐了,忽然想到网上有js解密工具,遂决定用来 ...

  7. 使用Sqlserver事务发布实现数据同步(转)

    出处:http://www.cnblogs.com/daizhj/archive/2009/11/18/1605293.html 事务的功能在sqlserver中由来已久,因为最近在做一个数据同步方案 ...

  8. WCF把书读薄(3)——数据契约、消息契约与错误契约

    上一篇:WCF把书读薄(2)——消息交换.服务实例.会话与并发 十二.数据契约 在实际应用当中数据不可能仅仅是以int Add(int num1, int num2)这种简单的几个int的方式进行传输 ...

  9. leetcode N-Queens I && N-Queens II

    第一个的代码: #include<iostream> #include<vector> using namespace std; bool isLegal(int i, int ...

  10. 如何为PAC运算设定请求集

    由于第一支PAC:定期请购成本处理程序 请求在运行过程中会自动提交 定期实际成本处理程序 请求,且 这两个请求不存在父子关系,导致 第二个请求尚未处理完成时 第一个请求已经运行完成,这就导致在设定请求 ...