Bootstrap 提前输入和 angular-schema-form 不工作

Bootstrap type-ahead and angular-schema-form not working

过滤器 "liveSearchEmployee()" 不会在控制器的父作用域上触发。它似乎被忽略了。

<input style="width:250px" type="text" ng-model="$$value$$"     ng-change="changeEmployee($$value$$)"    typeahead="(items.lastname + ', ' + items.firstname) for items in liveSearchEmployee($$value$$) "   typeahead-on-select="selectedPatientConsult($item)"    typeahead-min-length="3"   ng-hide="{{form.schema.readOnlyMode}}"    name="{{form.key}}" id="{{form.key}}" title="{{form.title}}"   ng-required="form.required" /> 

With "parent scope of the controller" 我想你的意思是它在表单之外的范围内?

指令 sf-schema 有一个独立的作用域,因此不会继承任何外部的东西。

尝试将您需要的内容放在表单定义对象上,而不是您的字段类型。

<input style="width:250px" type="text" ng-model="$$value$$"     
       ng-change="form.changeEmployee($$value$$)"  
       typeahead="(items.lastname + ', ' + items.firstname) for items in form.liveSearchEmployee($$value$$) "   
       typeahead-on-select="form.selectedPatientConsult($item)"    
       typeahead-min-length="3"   
       ng-hide="{{form.schema.readOnlyMode}}"    
       name="{{form.key}}" id="{{form.key}}" 
       title="{{form.title}}" ng-required="form.required" /> 

或者更好的是,将其包装在导出这些函数的指令中。