mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 13:33:03 +00:00
added normalized models and builders
This commit is contained in:
@@ -1,11 +1,4 @@
|
||||
import { Component, ChangeDetectionStrategy, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { Observable } from "rxjs";
|
||||
import { Collection } from "../core/shared/collection.model";
|
||||
import { Item } from "../core/shared/item.model";
|
||||
import { CollectionDataService } from "../core/data/collection-data.service";
|
||||
import { ItemDataService } from "../core/data/item-data.service";
|
||||
import { ObjectCacheService } from "../core/cache/object-cache.service";
|
||||
import { RemoteData } from "../core/data/remote-data";
|
||||
import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
@@ -14,16 +7,11 @@ import { RemoteData } from "../core/data/remote-data";
|
||||
styleUrls: ['./home.component.css'],
|
||||
templateUrl: './home.component.html'
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
data: any = {};
|
||||
collections: RemoteData<Collection[]>;
|
||||
items: RemoteData<Item[]>;
|
||||
export class HomeComponent {
|
||||
|
||||
constructor(
|
||||
private cds: CollectionDataService,
|
||||
private ids: ItemDataService,
|
||||
private objectCache: ObjectCacheService
|
||||
) {
|
||||
data: any = {};
|
||||
|
||||
constructor() {
|
||||
this.universalInit();
|
||||
}
|
||||
|
||||
@@ -31,13 +19,4 @@ export class HomeComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.collections = this.cds.findAll();
|
||||
this.items = this.ids.findAll();
|
||||
this.cds.findById('5179').payload.subscribe(o => console.log('collection 1', o));
|
||||
this.cds.findById('6547').payload.subscribe(o => console.log('collection 2', o));
|
||||
this.ids.findById('8871').payload.subscribe(o => console.log('item 1', o));
|
||||
this.ids.findById('9978').payload.subscribe(o => console.log('item 2', o));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user