AngularJS 2 uses a way to control the I / O properties between the parent and child components when invoking a child using route-config

I am creating an application using AngurarJS 2 where I created the parent component "LayoutComponent", and various child components are called using @RouteConfig. As below:

@RouteConfig([
{ path: '/dashboard', component: DashboardComponent, name: 'Dashboard', useAsDefault:true, data:{page:this.page} },
{ path: '/projects', component: ProjectListComponent, name: 'Project.list' },
{ path: '/project/:id', component: ProjectDetailComponent, name: 'Project.detail' },
{ path: '/project/add', component: ProjectAddComponent, name: 'Project.add' },
// { path: '/login', component: UserLoginComponent, name: 'User.login' },
{ path: '/logout', component: UserLogoutComponent, name: 'User.logout' },
{ path: '/users', component: UserListComponent, name: 'User.list' },
{ path: '/user/profile', component: UserProfileComponent, name: 'User.profile' },
{ path: '/user/:id', component: UserDetailComponent, name: 'User.detail' },
{ path: '/calendar', component: CalendarMainComponent, name: 'Calendar.main' },
{ path: '/emails', component: EmailListComponent, name: 'Email.list' },
// { path: '/user/register', component: UserRegisterComponent, name: 'User.register' },
])

LayoutComponent . <router-outlet></router-outlet> , . (, "title" ). directives, inputs , - , .

@RouteConfig. .

.

, , :

PageService . LayoutComponent page. "page" .

, , , script:

: '{{page.brdcrmb.title}}                   LayoutComponent @223: 37 ' .

+4
1

, , . -.

. Angular2?.

+2

All Articles