@@ -7,6 +7,7 @@ import 'rxjs/add/observable/forkJoin';
77
88// App specific
99import { AboutPageService } from './about-page.service' ;
10+ import { MetaTagsService } from '../shared/meta-tags/meta-tags.service' ;
1011
1112// Moment
1213import * as moment from 'moment/moment' ;
@@ -18,6 +19,7 @@ import * as moment from 'moment/moment';
1819export class AboutPageComponent implements OnInit {
1920 age : number ;
2021 isLoading = true ;
22+ pageName = 'About' ;
2123
2224 profilePictures = [ ] ;
2325 socialIcons = [ ] ;
@@ -27,23 +29,25 @@ export class AboutPageComponent implements OnInit {
2729 constructor ( private aboutMeService : AboutPageService ,
2830 private router : Router ,
2931 private title : Title ,
30- private meta : Meta ) {
32+ private meta : Meta ,
33+ private metaTagsService : MetaTagsService ) {
3134 }
3235
33- bounceImage ( event ) {
36+ bounceImage ( event ) : void {
3437 this . bouncer = event . type === 'mouseover' ? 'bounce-out' : 'no-bounce' ;
3538 }
3639
37- generateImage ( image ) {
40+ generateImage ( image ) : string {
3841 return 'data:image/jpeg;base64,' + image ;
3942 }
4043
41- doNavigate ( route ) {
44+ doNavigate ( route ) : void {
4245 this . router . navigate ( [ route ] ) ;
4346 }
4447
4548 ngOnInit ( ) : void {
46- this . age = moment ( ) . diff ( '1992-05-11' , 'years' ) ;
49+ this . setMetaData ( ) ;
50+ this . calculateAge ( ) ;
4751 Observable . forkJoin (
4852 this . aboutMeService . getImages ( ) ,
4953 this . aboutMeService . getSocialIcons ( )
@@ -52,8 +56,15 @@ export class AboutPageComponent implements OnInit {
5256 this . socialIcons = res [ 1 ] ;
5357 this . isLoading = false ;
5458 } ) ;
59+ }
60+
61+ setMetaData ( ) : void {
62+ this . meta . addTag ( this . metaTagsService . setMetaTag ( 'description' , `${ this . pageName } Page` ) ) ;
63+ this . title . setTitle ( this . metaTagsService . setPageTitle ( this . pageName ) ) ;
64+ }
5565
56- this . title . setTitle ( 'Maro Radovic - Web and Software Developer | About' ) ;
57- this . meta . addTag ( { name : 'description ', content : 'About page' } ) ;
66+ calculateAge ( ) : void {
67+ this . age = moment ( ) . diff ( '1992-05-11 ', 'years' ) ;
5868 }
69+
5970}
0 commit comments