I am looking for a solution using acute select
. I found some information on this website.
However, I encountered an error in the console after adding all the necessary dependencies.
MainPage.html
<ac-select ac-model='hospitalData.hospitalName'
ac-options='hospital.hospitalName as hospital.hospitalName for hospital in hospNameList'
ac-change='selectionChanged(value)'
ac-settings='{ loadOnOpen: true }'></ac-select>
Error
The ac-options and ac-model attributes must be set correctly <ac-select ac-model="hospitalData.hospitalName" ac-options="hospital.hospitalName as hospital.hospitalName for hospital in hospNameList" ac-change="selectionChanged(value)" ac-settings="{ loadOnOpen: true }" class="ng-isolate-scope">
Controller.js
scope.hospitalData=null;
scope.hospitalData.hospitalName=null;
scope.hospNameList=null;
//I added the above code after referring to an issue on GitHub, but it is still not working.
gethospNameList();
function gethospNameList() {
Repository.gethospNameList().then(
function(result) {
scope.hospNameList = result;
console.log("hospNameList :"+ scope.hospNameList);
});
};