和angularjs-xeditable的基本相似,主要区别在于前者用于普通input中,后者用于xeditable中

在angularjs-xeditable需要自动提示的地方要用e-uib-typeahead和e-typeahead-on-select,而在普通页面时需要使用uib-typeahead和typeahead-on-select。

当然首先需要加入模块

var Myapp = angular.module('Myapp ',['xeditable']);

 

HTML代码如下

angularjs-xeditable中

        <span editable-text="product.type" e-name="type" e-form="rowform" 
         e-uib-typeahead="products.type  for products in products | filter:$viewValue | limitTo:8" 
         e-typeahead-on-select="getProductDetail($item, $model)" 
          >
           {{ product.type || 'empty' }}
        </span>

 

普通的input中

<input type="text" id="choseDeviceName" name="choseDeviceName" class="form-control" ng-model="selected" 
uib-typeahead="products.type  for products in products | filter:$viewValue | limitTo:8" 
typeahead-on-select="funcGetProductDetail($item, $model, $label, $event)"  
> 

 JS的数据

 

$http.get('selectProducts').successs(function(data){
  $scope.products=data;
})

 

相关文章:

  • 2021-07-05
  • 2021-08-15
  • 2021-07-14
  • 2021-12-31
  • 2021-08-21
  • 2021-11-27
  • 2021-09-05
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2021-07-22
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案