Skip to content

Instantly share code, notes, and snippets.

@iamburakcoskun
Created October 27, 2019 13:42
Show Gist options
  • Save iamburakcoskun/94f839df951d755d9fba6ed3e5432c02 to your computer and use it in GitHub Desktop.
Save iamburakcoskun/94f839df951d755d9fba6ed3e5432c02 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from "@angular/core";
import { JobService } from "../_services/Job.service";
import { Job } from "src/models/Job";
import { AlertifyService } from "../_services/alertify.service";
@Component({
selector: "app-jobs",
templateUrl: "./jobs.component.html",
styleUrls: ["./jobs.component.css"],
providers: [JobService]
})
export class JobsComponent implements OnInit {
listTitle = "Job List";
jobs: Job[];
job: Job;
constructor(
private jobService: JobService,
private alertify: AlertifyService
) {}
ngOnInit() {
this.jobService.getjobs().subscribe(data => {
this.jobs = data;
});
}
apply(job) {
this.alertify.success("Successfully applied for " + job.title);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment