import { Component } from "@angular/core";
import { MessageService } from "primeng/api";
interface Course {
id: number;
name: string;
price: string;
}
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
providers: [MessageService]
})
export class AppComponent {
constructor(private ms: MessageService) { }
courses: Course[] = [];
selected: Course[] = [];
ngOnInit() {
this.courses = [
{
id: 1,
name: "Self Paced DSA",
price: "3,899"
},
{
id: 2,
name: "CIP - Self Paced",
price: "6,999"
},
{
id: 3,
name: "System Design - Live",
price: "10,999"
},
{
id: 4,
name: "CP - Live",
price: "10,999"
},
{
id: 5,
name: "C++ Self Paced",
price: "1,699"
},
{
id: 6,
name: "GATE 2024",
price: "11,999"
}
];
}
handleOnClick() {
this.ms.add({
severity: "success",
summary: "Component Clicked",
detail: "GeeksforGeeks"
})
}
handleOnChange() {
this.ms.add({
severity: "success",
summary: "Component Value Changed",
detail: "GeeksforGeeks"
})
}
handleOnPanelShow() {
this.ms.add({
severity: "success",
summary: "Panel Visible",
detail: "GeeksforGeeks"
})
}
handleOnPanelHide() {
this.ms.add({
severity: "success",
summary: "Pannel Hidden",
detail: "GeeksforGeeks"
})
}
}