Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60918312
navigation-service.service.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 3, 09:20
Size
1 KB
Mime Type
text/x-java
Expires
Sun, May 5, 09:20 (2 d)
Engine
blob
Format
Raw Data
Handle
17439830
Attached To
rSVGTESTAPP svg-test-app
navigation-service.service.ts
View Options
import {EventEmitter, Injectable} from '@angular/core';
import {NavigationEntity} from "../models/models";
import {NietzscheSourceSeviceService} from "./nietzsche-source-sevice.service";
import {Subscription} from "rxjs/index";
import {ActivatedRoute} from "@angular/router";
@Injectable({
providedIn: 'root'
})
export class NavigationServiceService {
constructor(private nietzscheSourceService: NietzscheSourceSeviceService, private activatedRoute: ActivatedRoute) { }
selectedManuscript: NavigationEntity;
selectedPage: NavigationEntity;
selectedWord: NavigationEntity;
navTreeDataChange = new EventEmitter<Array<NavigationEntity>>();
navTreeData: Array<NavigationEntity>;
manuscriptNavTree: Array<NavigationEntity> = [];
pageNavTree: Array<NavigationEntity> = [];
selectManuscript(id: string) {
// this.selectedManuscript = {};
}
setActiveNavigationTree(view: string) {
switch (view) {
case 'manuscript':
this.navTreeData = this.manuscriptNavTree;
break;
case 'page':
this.navTreeData = this.manuscriptNavTree;
break;
case 'rhizome':
this.navTreeData = this.manuscriptNavTree;
break;
}
this.navTreeDataChange.emit(this.navTreeData);
}
createManuscriptNavTree() {
this.nietzscheSourceService.getConvolutes().subscribe( res => {
const convolutes = res.result.children;
convolutes.forEach(x => {
const man = new NavigationEntity(x.id, x.api_retrieve_content);
this.manuscriptNavTree.push(man); });
this.navTreeDataChange.emit(this.manuscriptNavTree);
}
);
}
}
Event Timeline
Log In to Comment