ng new components-indepth --style=scss ng serve // Creating Components and adding Bootstrap ng g c blog-post-tile ng g c blog-list add bootstrap to index.html // create many components inside list component: inside app.component.html // inside blog-post-tile.component.html
{{title}}

{{summary}}

Read
// post-tile @Input() title: string; @Input() summary: string; ngOnInit() {} ======================================== ============= PAGINATION =============== ======================================== PIPES: ===== ng generate pipe truncate inside truncate.pipe.ts: transform(value: any, args?: any): any { const limit = args.length > 0 ? parseInt(args[0], 10) : 20; const trail = args.length > 1 ? args[1] : '...'; return value.length > limit ? value.substring(0, limit) + trail : value; } in blog-post-tile.component.html: {{post.summary | truncate:[30]}} in app.module.ts providers: [TruncatePipe], ======================================== Create BlogPost class export class BlogPost { isFav?: boolean; constructor(public title: string, public summary: string){ } } ======================================== // in blog-list.component.ts: blogPosts: BlogPost[][]; currentPage: number; in ngOnInit: this.blogPosts=[ [ {title: 'Post 1', summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i'}, {title: 'Post 2', summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i'}, {title: 'Post 3', summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i'}, ], [ {title: 'Post 4', summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i'}, {title: 'Post 5', summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i'}, {title: 'Post 6', summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i'}, ] ] this.currentPage = 0; ======================================== in blog-list.component.html: ======================= in blog-post-tile.component.ts: @Input() post: BlogPost; in blog-post-tile.component.html:
{{post.title}}

{{post.summary}}

Read
======================================== ng g c paginator ======================================== in paginator.component.html ====================== blog-list.component.html: add to the end ======================================== Change the previous iteration 4 using *ngFor in paginator.component.html to: ================================================ in paginator.component.ts: ===================== pages: number[]; numberOfPages : number = 3; ngOnInit() { this.pages = new Array(this.numberOfPages); } ======================================== 6- in paginator.component.ts: ===================== @Output() pageNumberClick = new EventEmitter() ; pageNumberClicked(pageNumber){ this.pageNumberClick.emit(pageNumber); } in blog-list.component.html: ===================== ======================================== in paginator.component.ts: ==================== @Input() numberOfPages; ======================================== 7- in blog-list.component.ts =================== updatePage(newPage){ console.log("Event emitted and method executed"); this.currentPage = newPage; }