Browse Source

feat: new skill tree with id get

0210225 4 tháng trước cách đây
mục cha
commit
8ee452f247

+ 2 - 2
src/modules/test/skill-tree/skill-tree.page.html

@@ -10,11 +10,11 @@
 <ion-content [fullscreen]="true">
   <ion-card>
     <ion-card-header>
-      <ion-card-title>{{clickedText}}</ion-card-title>
+      <ion-card-title>{{boleJob?.get("title")}}</ion-card-title>
     </ion-card-header>
 
     <ion-card-content>
-      <p>想成为{{clickedText}},您需要以下技能</p>
+      <p>想成为{{boleJob?.get("title")}},您需要以下技能</p>
 
 
       <iframe border="0" *ngIf="jobSkillHtml" [srcdoc]="jobSkillHtml">

+ 16 - 4
src/modules/test/skill-tree/skill-tree.page.ts

@@ -1,8 +1,9 @@
 import { Component, OnInit } from '@angular/core';
 import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
+import { ActivatedRoute } from '@angular/router';
 import { Transformer, builtInPlugins } from 'markmap-lib';
 import { fillTemplate } from 'markmap-render';
-
+import Parse from "parse";
 @Component({
   selector: 'app-skill-tree',
   templateUrl: './skill-tree.page.html',
@@ -11,14 +12,25 @@ import { fillTemplate } from 'markmap-render';
 export class SkillTreePage implements OnInit {
   clickedText:any
   constructor(
-    private domSan:DomSanitizer
+    private domSan:DomSanitizer,
+    private route:ActivatedRoute,
   ) { 
     this.clickedText = localStorage.getItem('clickedText')
     console.log(this.clickedText)
    }
 
-  ngOnInit() {
-    this.jobSkillHtml = this.domSan.bypassSecurityTrustHtml(this.renderMarkMind(this.jobSkillMarkdown))
+   boleJob:Parse.Object|undefined
+  async ngOnInit() {
+   let id = this.route.snapshot.paramMap.get("id")
+   if(id){
+      let query = new Parse.Query("BoleJob");
+      let job = await query.get(id)
+      this.boleJob = job
+      let markmind = job.get("markmind")
+      if(markmind){
+         this.jobSkillHtml = this.domSan.bypassSecurityTrustHtml(this.renderMarkMind(markmind))
+      }
+   }
   }
 
   renderMarkMind(markdown:string){