File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,13 @@ Component({
25
25
export class BlogComponent {
26
26
27
27
githubUrl :string ;
28
+ page :number ;
28
29
29
30
constructor ( blogService : BlogService ) {
30
31
31
32
this . blogService = blogService ;
32
- this . blogService . getBlogDetails ( ) . then ( ( response ) => {
33
+ this . page = 1 ;
34
+ this . blogService . getBlogDetails ( this . page ) . then ( ( response ) => {
33
35
this . blogResponse = response ;
34
36
} ) ;
35
37
this . githubUrl = "http://www.github.com/previousdeveloper"
Original file line number Diff line number Diff line change 1
1
export class BlogService {
2
-
3
- getBlogDetails ( ) :any {
4
2
5
- return Zone . bindPromiseFn ( fetch ) ( 'http://www.gokhankaradas.com/wp-json/posts' )
3
+ getBlogDetails ( page ) :any {
4
+
5
+ return Zone . bindPromiseFn ( fetch ) ( 'http://gokhankaradas.com/wp-json/posts?filter[post_status]=publish&filter[posts_per_page]=25&page=' + page + '&filter[orderby]=date&filter[order]=desc' )
6
6
. then ( function ( response ) {
7
7
return response . json ( ) ;
8
8
} ) ;
You can’t perform that action at this time.
0 commit comments