diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 599d92a..1c1f56d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,14 +10,16 @@ import { AngularFireModule } from '@angular/fire'; import { AngularFireDatabaseModule } from '@angular/fire/database'; import { environment } from '@env/environment'; import { GlobalErrorHandler } from '@app/core/global-error-handler/global-error-handler.service'; -import { LogService } from '@app/core/services'; +import { LogService, SEOService } from '@app/core/services'; import { AppMaterialModule } from '@app/app-material.module'; import { AppRoutingModule } from '@app/app-routing.module'; +import { HeaderComponent } from './header/header.component'; @NgModule({ declarations: [ AppComponent, HomeComponent, + HeaderComponent, ], imports: [ BrowserModule, @@ -29,6 +31,7 @@ import { AppRoutingModule } from '@app/app-routing.module'; ], providers: [ LogService, + SEOService, { provide: ErrorHandler, useClass: GlobalErrorHandler, diff --git a/src/app/core/services/seo/seo.service.ts b/src/app/core/services/seo/seo.service.ts index 9bfd42f..445cadf 100644 --- a/src/app/core/services/seo/seo.service.ts +++ b/src/app/core/services/seo/seo.service.ts @@ -7,10 +7,8 @@ import { filter, map, mergeMap } from 'rxjs/operators'; @Injectable() export class SEOService { - private defaultTitle = 'Constat à l\'amiable automatique'; - private defaultDescription = 'Notre projet consiste à aider les automobilistes en automatisant le remplissage du constat. C2A est intégré dans les' + - 'véhicules et récupère lors d’un accident les données de celui-ci (chocs, vitesse, position) pour remplir le constat. L’automobiliste obtiendra' + - 'son constat rempli sur son téléphone et après avoir apposé les signatures, le constat sera envoyé aux assureurs.'; + private defaultTitle = 'DiscoTrip'; + private defaultDescription = 'Nothing'; private defaultNoIndex = false; private defaultNoFollow = false; @@ -47,13 +45,13 @@ export class SEOService { } private setMetas( event: any ) { - event[ 'title' ] = ( !event[ 'title' ] ? this.defaultTitle : event[ 'title' ] ); - event[ 'description' ] = ( !event[ 'description' ] ? this.defaultDescription : event[ 'description' ] ); - event[ 'noindex' ] = ( !event[ 'noindex' ] ? this.defaultNoIndex : event[ 'noindex' ] ); - event[ 'nofollow' ] = ( !event[ 'nofollow' ] ? this.defaultNoFollow : event[ 'nofollow' ] ); - this.updateTitle( event[ 'title' ] + ' | C2A' ); - this.updateDescription( event[ 'description' ] ); - this.updateIndexFollow( event[ 'noindex' ], event[ 'nofollow' ] ); + event.title = ( !event.title ? this.defaultTitle : event.title ); + event.description = ( !event.description ? this.defaultDescription : event.description ); + event.noindex = ( !event.noindex ? this.defaultNoIndex : event.noindex ); + event.nofollow = ( !event.nofollow ? this.defaultNoFollow : event.nofollow ); + this.updateTitle( event.title + ' | C2A' ); + this.updateDescription( event.description ); + this.updateIndexFollow( event.noindex, event.nofollow ); } private routerListener() { diff --git a/src/app/header/header.component.css b/src/app/header/header.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html new file mode 100644 index 0000000..51bfb8c --- /dev/null +++ b/src/app/header/header.component.html @@ -0,0 +1,3 @@ +
+ header works! +
diff --git a/src/app/header/header.component.spec.ts b/src/app/header/header.component.spec.ts new file mode 100644 index 0000000..2d0479d --- /dev/null +++ b/src/app/header/header.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HeaderComponent } from './header.component'; + +describe('HeaderComponent', () => { + let component: HeaderComponent; + let fixture: ComponentFixture