2 つの依存ドロップダウンがあります。1 つは国を示し、もう 1 つは州を示しています。最初のものは国の ID だけを保存し、オブジェクト全体を 2 番目のドロップダウンのソースとして使用したいと思います。これが私がこれまでに持っているものです。これらのドロップダウンが同じ画面に多数存在する可能性があるため、一時変数 (countrySource) を複製する必要があるため、事態が複雑になる可能性があります。助言がありますか?
<select name="country" ng-model="countrySource" ng-options="cntr as cntr.label for cntr in countries" ng-change="country=countrySource.id">
</select>
<select name="state" ng-model="state" ng-options="st.id as st.label for st in countrySource.states">
</select>