Add Intro texto to Homepage
This commit is contained in:
parent
38ed7cda56
commit
6390e82599
@ -23,6 +23,7 @@ import { InterviewComponent } from './interview/interview.component';
|
|||||||
import { InterviewGridComponent } from './interview-grid/interview-grid.component';
|
import { InterviewGridComponent } from './interview-grid/interview-grid.component';
|
||||||
import { DedaloService } from './dedalo.service';
|
import { DedaloService } from './dedalo.service';
|
||||||
import { HideMarkers } from './pipe';
|
import { HideMarkers } from './pipe';
|
||||||
|
import { TextComponent } from './text/text.component';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@ -38,6 +39,7 @@ import { HideMarkers } from './pipe';
|
|||||||
InterviewComponent,
|
InterviewComponent,
|
||||||
InterviewGridComponent,
|
InterviewGridComponent,
|
||||||
HideMarkers,
|
HideMarkers,
|
||||||
|
TextComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
<header class="homepage" id="header" [ngStyle]="{'background-image': 'url(\'./assets/'+homeImage+'\')'}"></header>
|
<header class="homepage" id="header" [ngStyle]="{'background-image': 'url(\'./assets/'+homeImage+'\')'}"></header>
|
||||||
|
<app-text *ngIf="localeId==='eu'" slug='aurkezpena-industria-paisaia'></app-text>
|
||||||
|
<app-text *ngIf="localeId==='es'" slug='presentacion-paisaje-industrial'></app-text>
|
||||||
<app-section [pages]=pages></app-section>
|
<app-section [pages]=pages></app-section>
|
||||||
|
0
src/app/text/text.component.css
Normal file
0
src/app/text/text.component.css
Normal file
5
src/app/text/text.component.html
Normal file
5
src/app/text/text.component.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<article *ngIf="pages">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-10 offset-md-1 info col-xm-12" [innerHTML]="pages[0].content" style="font-size:1.5em;margin-bottom:50px;"></div>
|
||||||
|
</div>
|
||||||
|
</article>
|
25
src/app/text/text.component.spec.ts
Normal file
25
src/app/text/text.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { TextComponent } from './text.component';
|
||||||
|
|
||||||
|
describe('TextComponent', () => {
|
||||||
|
let component: TextComponent;
|
||||||
|
let fixture: ComponentFixture<TextComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ TextComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(TextComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
27
src/app/text/text.component.ts
Normal file
27
src/app/text/text.component.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { Component, OnInit, Input, Inject, LOCALE_ID} from '@angular/core';
|
||||||
|
import { PageService } from '../page.service';
|
||||||
|
import { PageItem } from '../page';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-text',
|
||||||
|
templateUrl: './text.component.html',
|
||||||
|
styleUrls: ['./text.component.css']
|
||||||
|
})
|
||||||
|
export class TextComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() slug:string;
|
||||||
|
pages:PageItem[];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private pageService: PageService,
|
||||||
|
@Inject(LOCALE_ID) protected localeId: string
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.pageService.getPage(this.slug)
|
||||||
|
.subscribe(data => {
|
||||||
|
this.pages = data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user