本文整理汇总了TypeScript中app/providers/project.service.ProjectService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.ProjectService类的具体用法?TypeScript service.ProjectService怎么用?TypeScript service.ProjectService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.ProjectService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: onDrop
onDrop(e: any, destinationStatus) {
var task = e.dragData;
var taskIndex = this.project.tasks.indexOf(task);
task.status = destinationStatus;
this.project.tasks[taskIndex] = task;
this.projectsService.update(this.project)
.subscribe((project) => console.log("updated", project));
}
示例2: getProject
getProject(): void {
const id = +this.route.snapshot.paramMap.get('id');
this.projectsService.getProject(id)
.subscribe(project => {
this.project = project;
this.statuses = project.statuses;
});
}
示例3: submit
submit() {
//TODO: validate form
if (!this.isValidField(this.project.name)
|| !this.isValidField(this.project.description)){
console.log('invalid');
return;
}
this.projectService.addProject(this.project)
.subscribe(project => {
console.log(`added project with id = ${project.id}`)
this.router.navigate(['/project', project.id]);
this.closeDialog();
});
}
示例4: getProjects
getProjects(): void {
this.projectsService.getProjects()
.subscribe(projects => this.projects = projects);
}