AngularJS - 使用xeditable和ng-AutoComplete

时间:2016-02-21 09:14:29

标签: angularjs

我有一个我使用angularJS xeditable编写的表单 我尝试将ngAutocomplete结合起来,以便在用户输入时自动填充地址数据(它是一个查询谷歌地图寻找地址的先行模块)。

问题是该值不是表单构建的JSON数据的一部分,我将其作为单独的值得到,将此自动完成值组合到rowform电子表单的最佳方法是什么?

谢谢!

以下是代码:

                                     日期          用户名           地点名称           市           地址           状态

      <tr height="1" class="table-data-font">
        <td width="270"><href="" e-name="eventDate" editable-bsdate="ev.eventDate" e-datepicker-popup="MM/dd/yy" e-form="rowform">
          {{ (ev.eventDate | date:"MM/dd/yy") || 'Choose Date' }}</a></td>

        <td>
          <span editable-select="ev.userName" e-name="userID" onshow="getusers()" e-ng-options="a.userID as a.userName for a in users" e-required> {{ showusers() || 'None'}}  </span>
        </td>
         <td> <span editable-text="ev.location" e-name="location" e-typeahead="' [' + v.locationID + '] ' + v.locationName + ' (' + v.locationCity + ') ' as v.locationName + ' (' + v.locationCity + ') ' for v in locations | filter:$viewValue | limitTo:8" e-required>
    {{ ev.location || 'Enter location Name' }} </span>
        </td>

        <td><span editable-text="ev.locationCity" e-name="locationCity" e-form="rowform" e-required>{{ ev.locationCity || 'None' }}</span></td>

 <td><input type="text" id="Autocomplete" ng-model="autocomplete" ng-autocomplete="locationAddress" details="details" options="options"/></td>
      <td><span editable-select="ev.eventStatus" e-name="eventStatus" e-form="rowform" e-ng-options="s for s in statuses" e-required>
       {{ ev.eventStatus || 'Confirmed'}} </span> </td>
    <tr height="2"></tr>

    <div class="buttons" ng-show="!rowform.$visible">
        <td colspan="4"> <button type="submit" ng-disabled="rowform.$waiting" class="btn btn-primary">
        save
      </button>
      <button type="button" ng-disabled="rowform.$waiting" ng-click="rowform.$cancel()" class="btn btn-default">
        cancel
      </button>
      <!-- <button class="btn btn-primary" ng-click="rowform.$show()">edit</button>
      <button class="btn btn-danger" ng-click="deleteevent(ev.eventID, $index)">del</button> -->         
    </form>

0 个答案:

没有答案