Angular FormGroup set value from API database











up vote
0
down vote

favorite












hello everyone i got problem when show value in angular forms from database API,
i have data from identity login employeeNumber and after that data from identity was automatic create to my api Employee, after that i want get that api to my forms booking, there is form employeeNumber,name, and function.



this is my image was i get value
enter image description here
this is my code component.ts



  public ngOnInit(): void {

//from uis
this.getDataFromUIS = this.employeeService.get();
// this.bookingvehicleForm.patchValue(this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber));
this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});
console.log(this.getDataFromUIS);
console.log(this.tampung3);
this.buildForm();
}

// Set variable form
private buildForm(): void {
let bookingDate: any;
if (this.bookingvehicle.bookingDate != null) {
bookingDate = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.bookingDate));
}
else {
bookingDate = this.dateconverter.DateToDTP(new Date());
}
let startPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.startPeriodeBooking));
let endPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.endPeriodeBooking));
let startHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.startHoursOfDeparture));
let endHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.endHoursOfDeparture));

this.bookingvehicleForm = this.fb.group({
'id': [this.bookingvehicle.id],
'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])],
'name': [this.tampung3.name, Validators.compose([Validators.required, Validators.maxLength(30)])],
'function' : [this.tampung3.function],
//'function': [this.bookingvehicleForm.controls['function'].value.employee.function],
'bookingDate': [bookingDate, Validators.compose([Validators.required, Validators.maxLength(30)])],
'startPeriodeBooking': [startPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'endPeriodeBooking': [endPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'destination': [this.bookingvehicle.destination, Validators.compose([Validators.required, Validators.maxLength(30)])],
'passenger': [this.bookingvehicle.passenger],
'reason': [this.bookingvehicle.reason, Validators.compose([Validators.required, Validators.maxLength(50)])],
'driveMode': [this.bookingvehicle.driveMode, Validators.compose([Validators.required, Validators.maxLength(20)])],
'startHoursOfDeparture': [startHoursOfDeparture],
'endHoursOfDeparture': [endHoursOfDeparture],
});
console.log(this.bookingvehicleForm);
};


why when i get from service the value was subcription? my problem is i cannot get value from service and show the value to my form



please help:)



public getUserLogin(employeeNumber: string){ 
console.log(this.employeeMemberURL +
this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber);
return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber)
.map(res => Helper.bufferToJSON(res));
}









share|improve this question
























  • where is your service call?
    – firegloves
    Nov 8 at 9:23










  • 'public getUserLogin(employeeNumber: string){ console.log(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber); return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber) .map(res => Helper.bufferToJSON(res)); }'
    – T M
    Nov 8 at 9:36

















up vote
0
down vote

favorite












hello everyone i got problem when show value in angular forms from database API,
i have data from identity login employeeNumber and after that data from identity was automatic create to my api Employee, after that i want get that api to my forms booking, there is form employeeNumber,name, and function.



this is my image was i get value
enter image description here
this is my code component.ts



  public ngOnInit(): void {

//from uis
this.getDataFromUIS = this.employeeService.get();
// this.bookingvehicleForm.patchValue(this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber));
this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});
console.log(this.getDataFromUIS);
console.log(this.tampung3);
this.buildForm();
}

// Set variable form
private buildForm(): void {
let bookingDate: any;
if (this.bookingvehicle.bookingDate != null) {
bookingDate = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.bookingDate));
}
else {
bookingDate = this.dateconverter.DateToDTP(new Date());
}
let startPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.startPeriodeBooking));
let endPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.endPeriodeBooking));
let startHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.startHoursOfDeparture));
let endHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.endHoursOfDeparture));

this.bookingvehicleForm = this.fb.group({
'id': [this.bookingvehicle.id],
'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])],
'name': [this.tampung3.name, Validators.compose([Validators.required, Validators.maxLength(30)])],
'function' : [this.tampung3.function],
//'function': [this.bookingvehicleForm.controls['function'].value.employee.function],
'bookingDate': [bookingDate, Validators.compose([Validators.required, Validators.maxLength(30)])],
'startPeriodeBooking': [startPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'endPeriodeBooking': [endPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'destination': [this.bookingvehicle.destination, Validators.compose([Validators.required, Validators.maxLength(30)])],
'passenger': [this.bookingvehicle.passenger],
'reason': [this.bookingvehicle.reason, Validators.compose([Validators.required, Validators.maxLength(50)])],
'driveMode': [this.bookingvehicle.driveMode, Validators.compose([Validators.required, Validators.maxLength(20)])],
'startHoursOfDeparture': [startHoursOfDeparture],
'endHoursOfDeparture': [endHoursOfDeparture],
});
console.log(this.bookingvehicleForm);
};


why when i get from service the value was subcription? my problem is i cannot get value from service and show the value to my form



please help:)



public getUserLogin(employeeNumber: string){ 
console.log(this.employeeMemberURL +
this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber);
return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber)
.map(res => Helper.bufferToJSON(res));
}









share|improve this question
























  • where is your service call?
    – firegloves
    Nov 8 at 9:23










  • 'public getUserLogin(employeeNumber: string){ console.log(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber); return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber) .map(res => Helper.bufferToJSON(res)); }'
    – T M
    Nov 8 at 9:36















up vote
0
down vote

favorite









up vote
0
down vote

favorite











hello everyone i got problem when show value in angular forms from database API,
i have data from identity login employeeNumber and after that data from identity was automatic create to my api Employee, after that i want get that api to my forms booking, there is form employeeNumber,name, and function.



this is my image was i get value
enter image description here
this is my code component.ts



  public ngOnInit(): void {

//from uis
this.getDataFromUIS = this.employeeService.get();
// this.bookingvehicleForm.patchValue(this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber));
this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});
console.log(this.getDataFromUIS);
console.log(this.tampung3);
this.buildForm();
}

// Set variable form
private buildForm(): void {
let bookingDate: any;
if (this.bookingvehicle.bookingDate != null) {
bookingDate = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.bookingDate));
}
else {
bookingDate = this.dateconverter.DateToDTP(new Date());
}
let startPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.startPeriodeBooking));
let endPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.endPeriodeBooking));
let startHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.startHoursOfDeparture));
let endHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.endHoursOfDeparture));

this.bookingvehicleForm = this.fb.group({
'id': [this.bookingvehicle.id],
'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])],
'name': [this.tampung3.name, Validators.compose([Validators.required, Validators.maxLength(30)])],
'function' : [this.tampung3.function],
//'function': [this.bookingvehicleForm.controls['function'].value.employee.function],
'bookingDate': [bookingDate, Validators.compose([Validators.required, Validators.maxLength(30)])],
'startPeriodeBooking': [startPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'endPeriodeBooking': [endPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'destination': [this.bookingvehicle.destination, Validators.compose([Validators.required, Validators.maxLength(30)])],
'passenger': [this.bookingvehicle.passenger],
'reason': [this.bookingvehicle.reason, Validators.compose([Validators.required, Validators.maxLength(50)])],
'driveMode': [this.bookingvehicle.driveMode, Validators.compose([Validators.required, Validators.maxLength(20)])],
'startHoursOfDeparture': [startHoursOfDeparture],
'endHoursOfDeparture': [endHoursOfDeparture],
});
console.log(this.bookingvehicleForm);
};


why when i get from service the value was subcription? my problem is i cannot get value from service and show the value to my form



please help:)



public getUserLogin(employeeNumber: string){ 
console.log(this.employeeMemberURL +
this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber);
return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber)
.map(res => Helper.bufferToJSON(res));
}









share|improve this question















hello everyone i got problem when show value in angular forms from database API,
i have data from identity login employeeNumber and after that data from identity was automatic create to my api Employee, after that i want get that api to my forms booking, there is form employeeNumber,name, and function.



this is my image was i get value
enter image description here
this is my code component.ts



  public ngOnInit(): void {

//from uis
this.getDataFromUIS = this.employeeService.get();
// this.bookingvehicleForm.patchValue(this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber));
this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});
console.log(this.getDataFromUIS);
console.log(this.tampung3);
this.buildForm();
}

// Set variable form
private buildForm(): void {
let bookingDate: any;
if (this.bookingvehicle.bookingDate != null) {
bookingDate = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.bookingDate));
}
else {
bookingDate = this.dateconverter.DateToDTP(new Date());
}
let startPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.startPeriodeBooking));
let endPeriodeBooking: any = this.dateconverter.DateToDTP(new Date(this.bookingvehicle.endPeriodeBooking));
let startHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.startHoursOfDeparture));
let endHoursOfDeparture: any = this.dateconverter.TimeToTP(new Date(this.bookingvehicle.endHoursOfDeparture));

this.bookingvehicleForm = this.fb.group({
'id': [this.bookingvehicle.id],
'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])],
'name': [this.tampung3.name, Validators.compose([Validators.required, Validators.maxLength(30)])],
'function' : [this.tampung3.function],
//'function': [this.bookingvehicleForm.controls['function'].value.employee.function],
'bookingDate': [bookingDate, Validators.compose([Validators.required, Validators.maxLength(30)])],
'startPeriodeBooking': [startPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'endPeriodeBooking': [endPeriodeBooking, Validators.compose([Validators.required, Validators.maxLength(20)])],
'destination': [this.bookingvehicle.destination, Validators.compose([Validators.required, Validators.maxLength(30)])],
'passenger': [this.bookingvehicle.passenger],
'reason': [this.bookingvehicle.reason, Validators.compose([Validators.required, Validators.maxLength(50)])],
'driveMode': [this.bookingvehicle.driveMode, Validators.compose([Validators.required, Validators.maxLength(20)])],
'startHoursOfDeparture': [startHoursOfDeparture],
'endHoursOfDeparture': [endHoursOfDeparture],
});
console.log(this.bookingvehicleForm);
};


why when i get from service the value was subcription? my problem is i cannot get value from service and show the value to my form



please help:)



public getUserLogin(employeeNumber: string){ 
console.log(this.employeeMemberURL +
this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber);
return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber)
.map(res => Helper.bufferToJSON(res));
}






angular






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 9:38









firegloves

3,06511025




3,06511025










asked Nov 8 at 9:11









T M

436




436












  • where is your service call?
    – firegloves
    Nov 8 at 9:23










  • 'public getUserLogin(employeeNumber: string){ console.log(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber); return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber) .map(res => Helper.bufferToJSON(res)); }'
    – T M
    Nov 8 at 9:36




















  • where is your service call?
    – firegloves
    Nov 8 at 9:23










  • 'public getUserLogin(employeeNumber: string){ console.log(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber); return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber) .map(res => Helper.bufferToJSON(res)); }'
    – T M
    Nov 8 at 9:36


















where is your service call?
– firegloves
Nov 8 at 9:23




where is your service call?
– firegloves
Nov 8 at 9:23












'public getUserLogin(employeeNumber: string){ console.log(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber); return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber) .map(res => Helper.bufferToJSON(res)); }'
– T M
Nov 8 at 9:36






'public getUserLogin(employeeNumber: string){ console.log(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber); return this.http.get(this.employeeMemberURL + this.config.ApiEndPoint.master.Employee + "getUserLogin"+ "/" + employeeNumber) .map(res => Helper.bufferToJSON(res)); }'
– T M
Nov 8 at 9:36














1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










You are requesting data and you are assigning the returning of subscribe() method to this.tampung3 with this instruction



this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});


But I think you want only data, so you should not manage subscribe() return type. You are assigning remote fetched data to this.employeModelTransaction with this statement:



this.employeModelTransaction = s;


And then you are never reading it.
So I think you should do something like this:



this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.tampung3 = s;
});





share|improve this answer





















  • and in build from, what variable i can do to show?
    – T M
    Nov 8 at 10:11










  • the variable you are assigning your data to: this.tampung3
    – firegloves
    Nov 8 at 10:30










  • like this? 'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])], or i must make new variable to assign tampung3?
    – T M
    Nov 8 at 11:44












  • the first time you should do is try it, because by this way, by making errors and analyzing them you will learn more things. however I think you should modify only the code I have posted. only getUserLogin's subscribe body. if you have still problems let me know
    – firegloves
    Nov 8 at 11:50










  • ok i will screenshoot in my questions :)
    – T M
    Nov 8 at 11:59











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204564%2fangular-formgroup-set-value-from-api-database%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










You are requesting data and you are assigning the returning of subscribe() method to this.tampung3 with this instruction



this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});


But I think you want only data, so you should not manage subscribe() return type. You are assigning remote fetched data to this.employeModelTransaction with this statement:



this.employeModelTransaction = s;


And then you are never reading it.
So I think you should do something like this:



this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.tampung3 = s;
});





share|improve this answer





















  • and in build from, what variable i can do to show?
    – T M
    Nov 8 at 10:11










  • the variable you are assigning your data to: this.tampung3
    – firegloves
    Nov 8 at 10:30










  • like this? 'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])], or i must make new variable to assign tampung3?
    – T M
    Nov 8 at 11:44












  • the first time you should do is try it, because by this way, by making errors and analyzing them you will learn more things. however I think you should modify only the code I have posted. only getUserLogin's subscribe body. if you have still problems let me know
    – firegloves
    Nov 8 at 11:50










  • ok i will screenshoot in my questions :)
    – T M
    Nov 8 at 11:59















up vote
0
down vote



accepted










You are requesting data and you are assigning the returning of subscribe() method to this.tampung3 with this instruction



this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});


But I think you want only data, so you should not manage subscribe() return type. You are assigning remote fetched data to this.employeModelTransaction with this statement:



this.employeModelTransaction = s;


And then you are never reading it.
So I think you should do something like this:



this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.tampung3 = s;
});





share|improve this answer





















  • and in build from, what variable i can do to show?
    – T M
    Nov 8 at 10:11










  • the variable you are assigning your data to: this.tampung3
    – firegloves
    Nov 8 at 10:30










  • like this? 'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])], or i must make new variable to assign tampung3?
    – T M
    Nov 8 at 11:44












  • the first time you should do is try it, because by this way, by making errors and analyzing them you will learn more things. however I think you should modify only the code I have posted. only getUserLogin's subscribe body. if you have still problems let me know
    – firegloves
    Nov 8 at 11:50










  • ok i will screenshoot in my questions :)
    – T M
    Nov 8 at 11:59













up vote
0
down vote



accepted







up vote
0
down vote



accepted






You are requesting data and you are assigning the returning of subscribe() method to this.tampung3 with this instruction



this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});


But I think you want only data, so you should not manage subscribe() return type. You are assigning remote fetched data to this.employeModelTransaction with this statement:



this.employeModelTransaction = s;


And then you are never reading it.
So I think you should do something like this:



this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.tampung3 = s;
});





share|improve this answer












You are requesting data and you are assigning the returning of subscribe() method to this.tampung3 with this instruction



this.tampung3 = this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.employeModelTransaction = s;
});


But I think you want only data, so you should not manage subscribe() return type. You are assigning remote fetched data to this.employeModelTransaction with this statement:



this.employeModelTransaction = s;


And then you are never reading it.
So I think you should do something like this:



this.employeeMemberService.getUserLogin(this.getDataFromUIS.employeeNumber)
.subscribe(s => {
this.tampung3 = s;
});






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 8 at 10:07









firegloves

3,06511025




3,06511025












  • and in build from, what variable i can do to show?
    – T M
    Nov 8 at 10:11










  • the variable you are assigning your data to: this.tampung3
    – firegloves
    Nov 8 at 10:30










  • like this? 'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])], or i must make new variable to assign tampung3?
    – T M
    Nov 8 at 11:44












  • the first time you should do is try it, because by this way, by making errors and analyzing them you will learn more things. however I think you should modify only the code I have posted. only getUserLogin's subscribe body. if you have still problems let me know
    – firegloves
    Nov 8 at 11:50










  • ok i will screenshoot in my questions :)
    – T M
    Nov 8 at 11:59


















  • and in build from, what variable i can do to show?
    – T M
    Nov 8 at 10:11










  • the variable you are assigning your data to: this.tampung3
    – firegloves
    Nov 8 at 10:30










  • like this? 'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])], or i must make new variable to assign tampung3?
    – T M
    Nov 8 at 11:44












  • the first time you should do is try it, because by this way, by making errors and analyzing them you will learn more things. however I think you should modify only the code I have posted. only getUserLogin's subscribe body. if you have still problems let me know
    – firegloves
    Nov 8 at 11:50










  • ok i will screenshoot in my questions :)
    – T M
    Nov 8 at 11:59
















and in build from, what variable i can do to show?
– T M
Nov 8 at 10:11




and in build from, what variable i can do to show?
– T M
Nov 8 at 10:11












the variable you are assigning your data to: this.tampung3
– firegloves
Nov 8 at 10:30




the variable you are assigning your data to: this.tampung3
– firegloves
Nov 8 at 10:30












like this? 'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])], or i must make new variable to assign tampung3?
– T M
Nov 8 at 11:44






like this? 'employee': [this.tampung3.employeeNumber, Validators.compose([Validators.required, Validators.maxLength(55)])], or i must make new variable to assign tampung3?
– T M
Nov 8 at 11:44














the first time you should do is try it, because by this way, by making errors and analyzing them you will learn more things. however I think you should modify only the code I have posted. only getUserLogin's subscribe body. if you have still problems let me know
– firegloves
Nov 8 at 11:50




the first time you should do is try it, because by this way, by making errors and analyzing them you will learn more things. however I think you should modify only the code I have posted. only getUserLogin's subscribe body. if you have still problems let me know
– firegloves
Nov 8 at 11:50












ok i will screenshoot in my questions :)
– T M
Nov 8 at 11:59




ok i will screenshoot in my questions :)
– T M
Nov 8 at 11:59


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204564%2fangular-formgroup-set-value-from-api-database%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Landwehr

Reims

Schenkenzell