diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index 119db74..262e2e5 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -1,6 +1,6 @@
-

Say Hi from Nerm, Front-End & UI Developer

+

Say Hi from Nerm, {{ _profileService.dataProfile.mainRole }} & {{ _profileService.dataProfile.secondRole }}

{{ _homeService.dataAbout.initial }}

diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index 5ed5f60..79f10e6 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; import { AboutService } from 'src/app/services/about.service'; +import { ProfileService } from 'src/app/services/profile.service'; @Component({ selector: 'app-home', @@ -8,8 +9,9 @@ import { AboutService } from 'src/app/services/about.service'; }) export class HomeComponent { - constructor( public _homeService: AboutService ) { - - } + constructor( + public _homeService: AboutService, + public _profileService: ProfileService + ) {} } diff --git a/src/app/interfaces/profile.interface.ts b/src/app/interfaces/profile.interface.ts new file mode 100644 index 0000000..a8124e4 --- /dev/null +++ b/src/app/interfaces/profile.interface.ts @@ -0,0 +1,8 @@ +export interface Profile { + imageProfile?:string, + email?: string, + location?: string, + mainRole?: string, + rights?: string, + secondRole?: string, +} diff --git a/src/app/services/profile.service.ts b/src/app/services/profile.service.ts new file mode 100644 index 0000000..f456444 --- /dev/null +++ b/src/app/services/profile.service.ts @@ -0,0 +1,24 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Profile } from '../interfaces/profile.interface'; + +@Injectable({ + providedIn: 'root' +}) +export class ProfileService { + + cargada = false; + dataProfile: Profile = {}; + + constructor( private http: HttpClient) { + this.getProfileData(); + } + + private getProfileData() { + this.http.get('https://portfolio-web-bd37a-default-rtdb.firebaseio.com/profile.json') + .subscribe( (response: Profile) => { + this.cargada = true; + this.dataProfile = response; + }) + } +} diff --git a/src/app/shared/profile/profile.component.html b/src/app/shared/profile/profile.component.html index 96e3828..3bc4f7e 100644 --- a/src/app/shared/profile/profile.component.html +++ b/src/app/shared/profile/profile.component.html @@ -4,17 +4,17 @@ Icon Portfolio -

Front-End &
UI Developer

+

{{ _profileService.dataProfile.mainRole }} &
{{ _profileService.dataProfile.secondRole }}

Profile picture
-

{{ role }}

- - {{ location }} - © {{ year }} Nerm. All Rights Reserved +

{{ _profileService.dataProfile.mainRole }} & {{ _profileService.dataProfile.secondRole }}

+ + {{ _profileService.dataProfile.location }} + © {{ year }} {{ _profileService.dataProfile.rights }}