|
@@ -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) {
|
|
onGetNew(id) {
|
|
this.router.navigate(['InternalPage/news/' + id])
|
|
this.router.navigate(['InternalPage/news/' + id])
|