Skip to content

Commit 3bf426a

Browse files
authored
Merge pull request #10 from hbweb/feat/topic-listing
Feat/topic listing
2 parents 854fe63 + 2d05806 commit 3bf426a

15 files changed

+122
-11
lines changed

src/app/shared/components/header/header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div
44
class="flex items-center text-3xl font-black text-gray-800 uppercase dark:text-white"
55
>
6-
<a href="/" routerLink="/"><span class="mt-1 ml-3 text-xs text-red-700"> Angular Pro </span></a>
6+
<a href="/" routerLink="/"><span class="mt-1 text-xs text-red-700"> Angular Pro </span></a>
77
</div>
88
<div class="flex items-center">
99
<nav

src/app/shared/data/topic-listing.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/app/shared/models/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './topic.interface';
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export interface Topic {
2+
id: number;
3+
title: string;
4+
icon: string;
5+
path: string;
6+
}
7+
8+
9+
export interface TopicsResponse {
10+
data: Topic[];
11+
status: number;
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TestBed } from '@angular/core/testing';
2+
3+
import { TopicService } from './topic.service';
4+
5+
describe('TopicService', () => {
6+
let service: TopicService;
7+
8+
beforeEach(() => {
9+
TestBed.configureTestingModule({});
10+
service = TestBed.inject(TopicService);
11+
});
12+
13+
it('should be created', () => {
14+
expect(service).toBeTruthy();
15+
});
16+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { HttpClient } from '@angular/common/http';
2+
import { Injectable } from '@angular/core';
3+
import { Observable } from 'rxjs';
4+
import { TopicsResponse } from 'src/app/shared/models';
5+
6+
@Injectable({
7+
providedIn: 'root'
8+
})
9+
export class TopicService {
10+
11+
constructor(private _httpClient: HttpClient) { }
12+
13+
public getTopics(): Observable<TopicsResponse> {
14+
return this._httpClient.get<TopicsResponse>('assets/data/topic-listing.json');
15+
}
16+
}

0 commit comments

Comments
 (0)