小编Pra*_*ana的帖子

如何在角度通用中使用localStorage?

我正在使用 @angular v4.0.3 和 webpack 2.2.0。

使用Auler post工作正常,但当我包含 localStorage 时它停止工作。有什么方法可以使它在 angular Universal 中工作或用于 localStorage 的任何模块

local-storage angular-local-storage angular-universal angular

5
推荐指数
1
解决办法
3131
查看次数

默认路由在角度 5 中不起作用

我已经设置了如下所示的延迟路由,

const appRoutes : Routes = [
{ path : '' , redirectTo : '/posts' , pathMatch:'full' },    
{ path : 'posts',  component:PostsComponent ,  children: [
    {path : 'contact' , component : ContactComponent },
    {path : ':slugurl' , component : SinglepostComponent }, 
    {path : 'category/:category' , component : PostfeedComponent },   
    {path : '' , component : PostfeedComponent },             
]},
{ path : 'about', loadChildren : './aboutme/aboutme.module#AboutmeModule' },    
{ path : 'admin',  loadChildren: './admin/admin.module#AdminModule' , canActivate: [ AuthGuard ] },  
{ …
Run Code Online (Sandbox Code Playgroud)

javascript angular-routing angular2-routing angular angular5

3
推荐指数
1
解决办法
3447
查看次数