Path正在通过链接工作,但是当我在浏览器中键入它时,它会以角度方式失败

时间:2017-09-28 11:01:20

标签: angular angular2-routing

我的路线如下

  path: '',
    component: FullLayoutComponent,
    children: [
      {
        path: 'testGame',
        component:TestGame,
        children:[{path:'list',component: ListTestGame},
                  {path:'crud',component: CrudTestGame}
        ]
       },

当我使用下面的列表时,一切正常。

 <li class="nav-item">
                    <a class="nav-link" routerLinkActive="active" [routerLink]="['/testGame/list']"><i class="icon-game-controller"></i> baran</a>
                </li>

但是当我在浏览器中键入相同的URL时,它会失败。谁能告诉我为什么会这样?当我使用HashLocationStrategy似乎没有问题时,它只发生在PathLocationStrategy

Failed to load resource: the server responded with a status of 404 (Not Found)
simple-line-icons.css Failed to load resource: the server responded with a status of 404 (Not Found)
simroll.css Failed to load resource: the server responded with a status of 404 (Not Found)
inline.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
polyfills.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
styles.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
scripts.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
styles.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
font-awesome.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
simple-line-icons.css Failed to load resource: the server responded with a status of 404 (Not Found)

0 个答案:

没有答案