• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / Other / Mock Cover

Mock Cover

export interface Cover {
caption: Caption;
image: Image;
}

export interface Caption {
title: string;
subtitle: string;
text: string;
btnLabel: string;
btnLink: string;
}

export interface Image {
src: string;
alt: string;
}
import { Cover } from './cover.model';

export const MockCover: Cover = {
caption: {
title: '',
text: '',
btnLabel: '',
btnLink: ''
},
image: {
src: '',
alt: '',
},
};
import { Injectable } from '@angular/core';
import { MockCover } from '../components/cover/cover.mock';

@Injectable({
providedIn: 'root',
})
export class MockService {
constructor() {}

getMockData() {
return MockCover;
}
}
export class CoverComponent {
mockData?: Cover;

constructor(private mockService: MockService) {
this.mockData = this.mockService.getMockData();
}
}
<div class="cover">
<div class="cover-caption">
<h1 class="cover-title">{{ mockData?.caption?.title }}</h1>
<p class="cover-description">
{{ mockData?.caption?.subtitle }}
</p>
<p class="cover-text">
{{ mockData?.caption?.text }}
</p>
<app-button
[btnLabel]="mockData?.caption?.btnLabel"
[btnLink]="mockData?.caption?.btnLink"
></app-button>
</div>
<figure class="cover-figure">
<img
class="cover-image"
[src]="mockData?.image?.src"
[alt]="mockData?.image?.alt"
/>
</figure>
</div>

Filed Under: Other

About Gabor Flamich

I'm a web developer and designer based in Budapest, Hungary. In recent years, I've documented hundreds of solutions I came across during development. This site is an archive for useful code snippets on WordPress, Genesis Framework and WooCommerce. If You have any questions related to WordPress development, get in touch!

Primary Sidebar

  • angular.io
© 2026 WP Flames - All Right Reserved