import { Component, OnInit } from '@angular/core';
import {Observable} from "rxjs/Rx";
import {DemoService} from './DemoService.service';
import { Http, Response, Headers, RequestOptions} from "@angular/http";
@Component({
selector: 'my-app',
templateUrl:'../app/app.component.html',
providers: [DemoService]
})
export class AppComponent {
//public foods;
//public new_food;
public ID;
public param1;
public param2;
public param3;
public param4;
public param5;
public param6;
constructor( private demoservice:DemoService){}
SendToApi(ID,param1,param2,param3,param4,param5,param6) {
console.log(ID,param1,param2,param3,param4,param5,param6);
let data = {ID: ID,param1:param1,param2:param2,param3:param3,param4:param4,param5:param5,param6:param6};
this.demoservice.AddDetails(data).subscribe(
error => {
console.error("Error saving params!");
return Observable.throw(error);
}
);
}
}