<vn-crud-model
    url="TaxClasses"
    fields="['id', 'description', 'code']"
    data="classes"
    auto-load="true">
</vn-crud-model>
<vn-watcher
    vn-id="watcher"
    data="$ctrl.taxes"
    form="form">
</vn-watcher>
<form name="form" ng-submit="$ctrl.submit()" class="vn-w-md">
    <vn-card class="vn-pa-lg">
        <vn-horizontal ng-repeat="tax in $ctrl.taxes">
            <vn-textfield
                vn-one
                label="Country"
                ng-model="tax.country.name"
                disabled="true">
            </vn-textfield>
            <vn-autocomplete
                vn-one
                label="Class"
                ng-model="tax.taxClassFk"
                data="classes"
                show-field="description">
            </vn-autocomplete>
        </vn-horizontal>
    </vn-card>
    <vn-button-bar>
        <vn-submit
            disabled="!watcher.dataChanged()"
            label="Save">
        </vn-submit>
        <!-- # #2680 Undo changes button bugs -->
        <!-- <vn-button
            class="cancel"
            label="Undo changes"
            disabled="!watcher.dataChanged()"
            ng-click="watcher.loadOriginalData()">
        </vn-button> -->
    </vn-button-bar>
</form>