"json-loader": "^0.5.4",
"ng2-bootstrap": "1.1.16",
"ng2-file-upload": "^1.1.0",
+ "ng2-meta": "github:chocobozzz/ng2-meta",
"node-sass": "^3.10.0",
"normalize.css": "^5.0.0",
"raw-loader": "^0.5.1",
import { AccountComponent } from './account.component';
export const AccountRoutes = [
- { path: 'account', component: AccountComponent }
+ {
+ path: 'account',
+ component: AccountComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - My account'
+ }
+ }
+ }
];
},
{
path: 'list',
- component: FriendListComponent
+ component: FriendListComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Friends list'
+ }
+ }
},
{
path: 'add',
- component: FriendAddComponent
+ component: FriendAddComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Add friends'
+ }
+ }
}
]
}
},
{
path: 'stats',
- component: RequestStatsComponent
+ component: RequestStatsComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Request stats'
+ }
+ }
}
]
}
},
{
path: 'list',
- component: UserListComponent
+ component: UserListComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Users list'
+ }
+ }
},
{
path: 'add',
- component: UserAddComponent
+ component: UserAddComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Add a user'
+ }
+ }
}
]
}
import { Component, ViewContainerRef } from '@angular/core';
import { Router } from '@angular/router';
+import { MetaService } from 'ng2-meta';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
export class AppComponent {
constructor(
private router: Router,
+ private metaService: MetaService,
viewContainerRef: ViewContainerRef
) {}
import { removeNgStyles, createNewHosts } from '@angularclass/hmr';
import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
+
import { DropdownModule } from 'ng2-bootstrap/components/dropdown';
import { ProgressbarModule } from 'ng2-bootstrap/components/progressbar';
import { PaginationModule } from 'ng2-bootstrap/components/pagination';
import { ModalModule } from 'ng2-bootstrap/components/modal';
+
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
+import { MetaConfig, MetaModule } from 'ng2-meta';
+
/*
* Platform and Environment providers/directives/pipes
*/
WebTorrentService
} from './videos';
+const metaConfig: MetaConfig = {
+ //Append a title suffix such as a site name to all titles
+ //Defaults to false
+ useTitleSuffix: true,
+ defaults: {
+ title: 'PeerTube'
+ }
+};
+
// Application wide providers
const APP_PROVIDERS = [
AppState,
ProgressbarModule,
PaginationModule,
ModalModule,
- FileUploadModule
+
+ FileUploadModule,
+
+ MetaModule.forRoot(metaConfig)
],
providers: [ // expose our Services and Providers into Angular's dependency injection
ENV_PROVIDERS,
import { LoginComponent } from './login.component';
export const LoginRoutes = [
- { path: 'login', component: LoginComponent }
+ {
+ path: 'login',
+ component: LoginComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Login'
+ }
+ }
+ }
];
children: [
{
path: 'list',
- component: VideoListComponent
+ component: VideoListComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Videos list'
+ }
+ }
},
{
path: 'add',
- component: VideoAddComponent
+ component: VideoAddComponent,
+ data: {
+ meta: {
+ titleSuffix: ' - Add a video'
+ }
+ }
},
{
path: 'watch/:id',