相关疑难解决方法(0)

在Angular中,什么是'pathmatch:full',它有什么作用?

在这里它使用pathmatch作为完整,当我删除此路径匹配时,它甚至不加载应用程序或运行项目

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';

import { AppComponent }  from './app.component';
import { WelcomeComponent } from './home/welcome.component';

/* Feature Modules */
import { ProductModule } from './products/product.module';

@NgModule({
  imports: [
    BrowserModule,
    HttpModule,
    RouterModule.forRoot([
      { path: 'welcome', component: WelcomeComponent },
      { path: '', redirectTo: 'welcome', pathMatch: 'full' },
      { path: '**', redirectTo: 'welcome', pathMatch: 'full' }
    ]),
    ProductModule
  ],
  declarations: [ …
Run Code Online (Sandbox Code Playgroud)

typescript angular

74
推荐指数
4
解决办法
7万
查看次数

标签 统计

angular ×1

typescript ×1