Selaa lähdekoodia

appCategoryService优化

shimingxy 8 kuukautta sitten
vanhempi
commit
d8997bbadd

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 4
maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.html


+ 6 - 3
maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.ts

@@ -118,12 +118,15 @@ export class HomeComponent implements OnInit {
     });
   }
 
-  changeCategory(): void {
-    if (this.appCategoryService.list() === null || this.appCategoryService.list() === '') {
+  changeCategory(category: String): void {
+    //console.log(category);
+    if (this.appCategoryService.list() === null || this.appCategoryService.list() === '' || category === 'All') {
       this.appList = this.staticAppList;
     } else {
+      this.appList = [];
       for (let i = 0; i < this.staticAppList.length; i++) {
-        if (this.staticAppList[i].category === this.appCategoryService.list()) {
+        //console.log(this.staticAppList[i]);
+        if (this.staticAppList[i].category === this.appsCategory) {
           this.appList.push(this.staticAppList[i]);
         }
       }

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä