Using angular-multi-select I want to show selected options upon load

I'm using angular-multi-select (https://github.com/isteven/angular-multi-select) and loading a table based on inputs that are locally stored. I am successfully loading my table with the inputs but as far as my mutliselect showing which options are selected that is not reflected. My multiselect dropdown shows "None Selected" upon load because it seems as though it clears out selected or 'ticked' items upon load, although my table is reflecting the selected items I want to show. How can I show preselected items in the dropdown on load? Here is the code I'm using...

              <div ng-hide="loadingCompanies"
                   isteven-multi-select
                   input-model="companies"
                   output-model="multiSelect.payorCompanies"
                   button-label="name"
                   item-label="name"
                   tick-property="ticked"
                   output-properties="id ticked"
                   max-labels="1"
              >
              </div>

and in my controller I have...

$scope.multiSelect = {};
$scope.multiSelect.payorCompanies = ReportService.getStoredReportFilter().payorCompanies;

$scope.multiSelect.payorCompanies is an array of payorCompanies with the 'ticked' attribute equaling true.

Answers


I got it. I actually just had to set each item in $scope.companies to have a 'ticked' attribute that equals true :)


Need Your Help

Targeting using Criteria ID

google-maps google-maps-api-3 google-adwords

Maybe you know if and how I can use Criteria ID taken from Adwords APi

How to check if a child exists in firebase?

android firebase firebase-realtime-database

I have a firebase that has a node called users. The user gives a username and I want to check to see if that username already exists as a child of the users node. This is the code I am currently tr...