Renamed many components + started implementing lazy loading
This commit is contained in:
1 parent
c8578ccf77
commit
60b517500f
80 files changed
+274
-242
No files matched your search
@@ -6,9 +6,11 @@ import { LibraryService } from './services/library.service';
|
||||
import { EntryService } from './services/entry.service';
|
||||
import { ListService } from './services/list.service';
|
||||
import { ToggleService } from './services/toggle.service';
|
||||
import { SidebarComponent } from './components/sidebar/sidebar.component';
|
||||
import { NavbarComponent } from './components/navbar/navbar.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
declarations: [SidebarComponent, NavbarComponent],
|
||||
imports: [CommonModule],
|
||||
providers: [
|
||||
TmdbService,
|
||||
@@ -17,6 +19,7 @@ import { ToggleService } from './services/toggle.service';
|
||||
ListService,
|
||||
ToggleService,
|
||||
],
|
||||
exports: [SidebarComponent, NavbarComponent],
|
||||
})
|
||||
export class CoreModule {
|
||||
constructor(@Optional() @SkipSelf() parentModule?: CoreModule) {
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { DateFormatPipe } from './date-format.pipe';
|
||||
|
||||
describe('DateFormatPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new DateFormatPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'dateFormat'
|
||||
})
|
||||
export class DateFormatPipe implements PipeTransform {
|
||||
|
||||
transform(value: string): string {
|
||||
if (!value) return '';
|
||||
|
||||
const date = new Date(value);
|
||||
const formatter = new Intl.DateTimeFormat('en-US', { month: 'long', day: '2-digit', year: 'numeric' });
|
||||
return formatter.format(date);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { List } from '../../shared/models/list.model';
|
||||
import { UserCollection } from '../../shared/models/userCollection.model';
|
||||
import { ListEntry } from '../../shared/models/listEntry.model';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
|
||||
@@ -13,18 +13,18 @@ export class ListService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
// get all lists
|
||||
getLists(): Observable<List[]> {
|
||||
return this.http.get<List[]>(`${this.backend_apiUrl}/lists`);
|
||||
getLists(): Observable<UserCollection[]> {
|
||||
return this.http.get<UserCollection[]>(`${this.backend_apiUrl}/lists`);
|
||||
}
|
||||
|
||||
// get a list by id
|
||||
getList(id: string) {
|
||||
return this.http.get<List[]>(`${this.backend_apiUrl}/lists/${id}`);
|
||||
return this.http.get<UserCollection[]>(`${this.backend_apiUrl}/lists/${id}`);
|
||||
}
|
||||
|
||||
// Create a new list
|
||||
createList(list: List): Observable<List> {
|
||||
return this.http.post<List>(`${this.backend_apiUrl}/lists`, list);
|
||||
createList(list: UserCollection): Observable<UserCollection> {
|
||||
return this.http.post<UserCollection>(`${this.backend_apiUrl}/lists`, list);
|
||||
}
|
||||
|
||||
// Delete a list by ID
|
||||
|
||||
Reference in new issue
Block a user