Html 添加上下文路径2
我想运行我的应用程序,而不是在Html 添加上下文路径2,html,angular,href,angular2-routing,Html,Angular,Href,Angular2 Routing,我想运行我的应用程序,而不是在 我试图更改index.html上的基本href,但我得到了未捕获的语法错误:意外标记您可以使用angular 2中的路由模块,并在url中未设置路径时将用户重定向到/pilot 因此,在app.routing.ts中会有类似的代码 {路径:'',重定向到:'/pilot',路径匹配:'full'} 仍然需要看看这是否可以在没有路由的情况下完成。最后,在我的index.html中,这已经足够了: <base href="/pilot/"> impo
我试图更改index.html上的基本href,但我得到了未捕获的语法错误:意外标记您可以使用angular 2中的路由模块,并在url中未设置路径时将用户重定向到/pilot 因此,在app.routing.ts中会有类似的代码 {路径:'',重定向到:'/pilot',路径匹配:'full'}
仍然需要看看这是否可以在没有路由的情况下完成。最后,在我的index.html中,这已经足够了:
<base href="/pilot/">
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { MessagesModule } from 'primeng/primeng';
import { InputTextModule } from 'primeng/primeng';
import { PasswordModule } from 'primeng/primeng';
import { ButtonModule } from 'primeng/primeng';
import { DataTableModule, SharedModule } from 'primeng/primeng';
import { DialogModule } from 'primeng/primeng';
import { CarService } from './service/carservice';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
ButtonModule,
MessagesModule,
InputTextModule,
PasswordModule,
ReactiveFormsModule,
DataTableModule,
SharedModule,
DialogModule
],
providers: [CarService],
bootstrap: [AppComponent]
})
export class AppModule { }
<base href="/pilot/">