小编Ale*_*der的帖子

Angular 5 Universal排除服务器上呈现的路径

有什么方法我只能强制Angular 5通用应用程序的特定路径的浏览器渲染?我在app.module.shared.ts中有以下路线

@NgModule({
    declarations: [...],
    imports: [
        ......
        RouterModule.forRoot([
            { path: '', redirectTo: 'home', pathMatch: 'full' },
            { path: 'home', component: HomeComponent },
            { path: 'auth-callback', component: AuthCallbackComponent},
            { path: '**', redirectTo: 'home' }        
        ]
        )
    ],
    providers: []
})
Run Code Online (Sandbox Code Playgroud)

我希望mysite.com/auth-callback只能在浏览器中呈现,而不是在服务器端呈现.感谢您的帮助,未能找到任何帮助信息.

javascript universal angular

6
推荐指数
1
解决办法
844
查看次数

Angular 4.错误"无法绑定到'ngModule',因为它不是"的已知属性"但是在app.module.shared.ts中导入了FormsModule

我坚持" 无法绑定到'ngModule',因为它不是'select'的已知属性. "错误.该解决方案应该在app.module.shared.ts文件中导入FormsModule.我做了,但我仍然得到同样的错误.

app.module.shared.t

import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { AppComponent } from './components/app/app.component';
import { NavMenuComponent } from './components/navmenu/navmenu.component';
import { HomeComponent } from './components/home/home.component';
import { StatisticComponent} from './components/statistic/statistic.component';
import { StatisticViewComponent } from './components/statisticview/statisticview.component';
import { StatService } from './components/services/stat.service';


@NgModule({
    declarations: [
        AppComponent,
        NavMenuComponent,
        HomeComponent,
        StatisticComponent,
        StatisticViewComponent
    ],
    imports: [ …
Run Code Online (Sandbox Code Playgroud)

typescript angular

2
推荐指数
1
解决办法
212
查看次数

标签 统计

angular ×2

javascript ×1

typescript ×1

universal ×1