【发布时间】:2019-11-06 06:35:44
【问题描述】:
我的 app-routing.module.ts 中有这条路线缺少一些东西,因为 当我进入这个页面时
我收到错误,但是当我去这里时它可以工作
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SearchBooksComponent } from './search-books/search-books.component';
const routes: Routes = [
{
path: '',
redirectTo: '/search',
pathMatch: 'full'
},
{
path: 'search',
component: SearchBooksComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
路线有什么问题?
这是我的 app.yaml
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: dist/index.html
upload: dist/index.html
- url: /
static_dir: dist
【问题讨论】:
-
您的服务器配置。 RTFM
-
还要确保
redirectTo: 'search', -
错误是什么?
-
是的,但我是新手,不知道手册:)