Skip to content

API /Remote service data is not populating ( angular-schema-form-dynamic select) #116

@kirantejj

Description

@kirantejj

scenario 1 :working with static data

xyz.ts

public populateTitleMap() {
var vm = this;

    return [
          { value: "value1", name: "text1" },
         { value: "value2", name: "text2" },
           { value: "value3", name: "Select dynamic!" }
       ];

}

scenario 2 : not working for dynamic data(api call)

xyz.ts file

public populateTitleMap(id:any) {
var vm = this;
var data;
var collection;
vm.taskService.getDictionaryData(id).then(function (response) {
data = response.data;
var x = data.split(',')[0];
var y = data.split(',')[1];

collection= [{ value: x, name: y }, { value: x, name: y }];
return collection;
});
}

the Above code returns data but it is not binding to dropdown whyyyyyyyyyyyyyyy?

it is showing error message as

A callback string must match name of a function in the parent scope undefined
2.Possibly unhandled rejection: A callback string must match name of a function in the parent scope undefined
abcd.cs

callback = "vm.populateTitleMap(" + entityAttribute.enum_type + ")"

please send a quick response to this thread........

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions