1
你好,我想创建一个服务,restangular更新数据如何创建一个restangular服务来更新数据
import {Injectable} from '@angular/core';
import {Project} from '../model/index';
import {id} from '@swimlane/ngx-datatable/release/utils';
import {Restangular} from 'ngx-restangular';
@Injectable()
export class updateprojectService {
constructor (private restangular: Restangular) {}
update(project: Project) {
return this.restangular.all('projects').customPUT(project, {'id': project.id}, undefined, {'Content-Type': undefined});
}
}
也许错误是指定路径中的ID