am getting the details from a service and assigning it to an loginDetailsArray array. now i need to call the functions() only after getting the data successful. i just tried to call functions() directly, but it is reading that function before getting the data. i was thinking about using call back function here. but as am new to this, i have no idea of how to get it. Thanks in advance.
loadLoginDetails() {
this.customerService.getLoginDetails().subscribe(res => {
this.loginDetailsArray = res.json();
});
}
functions() {
var minLength = this.loginDetailsArray.rules.username.minlength;
var maxLength = this.loginDetailsArray.rules.username.maxlength;
var pattern = this.loginDetailsArray.rules.username.pattern;
}