Hima 5 anni fa
parent
commit
296b024cd6

+ 2 - 0
src/app/External-Page/more-news/more-news.component.ts

@@ -68,6 +68,7 @@ export class MoreNewsComponent implements OnInit {
    // /change page 
    onPageChange(pagenationNumber) {
     this.spinner.show();
+    this.currentPage = pagenationNumber;
     this.http.get(this.authSer.pathApi + '/get_reports_list/1/' + this.currentPage + '/' + this.perPagePagenation + '/internal').subscribe(
       (responce) => {
         console.log(responce);
@@ -79,6 +80,7 @@ export class MoreNewsComponent implements OnInit {
             this.dataPagesNews[i].description_en = this.dataPagesNews[i].description_en.substring(0,200) + '......';
           }
         }
+        this.spinner.hide();
       },
       (error) => {
         console.log(error);      

+ 22 - 19
src/app/Internal-Page/news-pages/news-pages.component.ts

@@ -59,26 +59,29 @@ export class NewsPagesComponent implements OnInit {
 
   }
 
-      // /change page 
-      onPageChange(pagenationNumber) {
-        this.spinner.show();
-        this.http.get(this.authSer.pathApi + '/reports_list_gate/' + this.currentPage + '/' + this.perPagePagenation + '/internal').subscribe(
-          (responce) => {
-            console.log(responce);
-            this.dataPagesNews = responce['reports'];
-            this.count = responce['count'];
-            for(let i = 0 ; i < this.dataPagesNews.length ; i++) {
-              if(this.dataPagesNews[i].description.length > 60) {
-                this.dataPagesNews[i].description = this.dataPagesNews[i].description.substring(0,200) + '........' ;
-                this.dataPagesNews[i].description_en = this.dataPagesNews[i].description_en.substring(0,200) + '......';
-              }
-            }
-          },
-          (error) => {
-            console.log(error);      
+  // /change page 
+  onPageChange(pagenationNumber) {
+    this.spinner.show();
+    console.log(pagenationNumber);
+    this.currentPage = pagenationNumber;
+    this.http.get(this.authSer.pathApi + '/reports_list_gate/' + this.currentPage + '/' + this.perPagePagenation + '/internal').subscribe(
+      (responce) => {
+        console.log(responce);
+        this.dataPagesNews = responce['reports'];
+        this.count = responce['count'];
+        for(let i = 0 ; i < this.dataPagesNews.length ; i++) {
+          if(this.dataPagesNews[i].description.length > 60) {
+            this.dataPagesNews[i].description = this.dataPagesNews[i].description.substring(0,200) + '........' ;
+            this.dataPagesNews[i].description_en = this.dataPagesNews[i].description_en.substring(0,200) + '......';
           }
-        )
-      };
+        }
+        this.spinner.hide();
+      },
+      (error) => {
+        console.log(error);      
+      }
+    )
+  };
 
   onGetNew(id) {
     this.router.navigate(['InternalPage/news/' + id])

+ 3 - 0
src/app/shared/auth-service.service.ts

@@ -50,8 +50,11 @@ export class AuthServiceService {
   showArabicIcon:boolean;
   showEnglishIcon:boolean;
 
+  // pathApi: string = 'http://10.93.50.2/kfmc_back_end/index.php/api';
+  // pathImg: string = "http://10.93.50.2/kfmc_back_end/public/";
   pathApi: string = 'http://kfmc.info/back_end/api';
   pathImg: string = "http://kfmc.info/back_end/public/";
+  
   myInnerHeight = window.innerHeight;
   imgSrc: string =  '../../assets/image/avatar.png'; //page profile default
   iconImg: string = '../../assets/image/Group 92.png';