import { Component, OnInit, ViewChild } from
'@angular/core'
;
import { Table } from
'primeng/table'
;
import { PrimeNGConfig } from
'primeng/api'
;
import { MessageService } from
'primeng/api'
;
@Component({
selector:
'app-root'
,
templateUrl:
'./app.component.html'
,
styles: [
`
:host ::ng-deep .p-cell-editing {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
`,
],
})
export class AppComponent {
tutorials: Tutorial[];
@ViewChild(
'dt'
) table: Table;
clonedTutorials: { [s: string]: Tutorial } = {};
constructor(private primengConfig: PrimeNGConfig) { }
ngOnInit() {
this
.tutorials = [
{
title:
'Queue'
,
category:
'Data Structure'
,
rating: 8,
},
{
title:
'Circularly LinkedList'
,
category:
'Data Structure'
,
rating: 1,
},
{
title:
'Doubly LinkedList'
,
category:
'Data Structure'
,
rating: 3,
},
{
title:
'Singly LinkedList'
,
category:
'Data Structure'
,
rating: 5,
},
{
title:
'Doubly Ended Queue'
,
category:
'Data Structure'
,
rating: 10,
},
{
title:
'Binary Search Tree'
,
category:
'Data Structure'
,
rating: 2,
},
{
title:
'Red Black Tree'
,
category:
'Data Structure'
,
rating: 9,
},
{
title:
'Breadth First Search'
,
category:
'Graph'
,
rating: 6,
},
{
title:
"Floyd's Cycle"
,
category: 'Algorithm
',
rating: 7,
},
{
title: '
Travelling Salesman Problem
',
category: '
Algorithm
',
rating: 4,
},
{
title: '
Bellman Ford
',
category: '
Graph
',
rating: 8,
},
{
title: '
KMP Algorithm
',
category: '
String
',
rating: 10,
},
];
this.primengConfig.ripple = true;
}
updateView() {
this.tutorials = [
{
title: '
Queue
',
category: '
Data Structure
',
rating: 8,
},
{
title: '
Circularly LinkedList
',
category: '
Data Structure
',
rating: 1,
},
{
title: '
Doubly LinkedList
',
category: '
Data Structure
',
rating: 3,
},
{
title: '
Singly LinkedList
',
category: '
Data Structure
',
rating: 5,
},
{
title: '
Doubly Ended Queue
',
category: '
Data Structure
',
rating: 10,
},
{
title: '
Binary Search Tree
',
category: '
Data Structure
',
rating: 2,
},
{
title: '
Red Black Tree
',
category: '
Data Structure
',
rating: 9,
},
{
title: '
Breadth First Search
',
category: '
Graph
',
rating: 6,
},
{
title: "Floyd'
s Cycle",
category:
'Algorithm'
,
rating: 7,
},
{
title:
'Travelling Salesman Problem'
,
category:
'Algorithm'
,
rating: 4,
},
{
title:
'Bellman Ford'
,
category:
'Graph'
,
rating: 8,
},
{
title:
'KMP Algorithm'
,
category:
'String'
,
rating: 10,
},
{
title:
'Djikstra Shortest Path'
,
category:
'Graph'
,
rating: 5,
},
];
}
}
export interface Tutorial {
title?: string;
category?: string;
rating?: number;
}