Angularjs 在有角度的js中提前键入不工作

Angularjs 在有角度的js中提前键入不工作,angularjs,typeahead.js,angular-ui-typeahead,Angularjs,Typeahead.js,Angular Ui Typeahead,我在一个项目中工作,在这个项目中,我必须从mongod中检索详细信息,并在文本框中提前显示它 我的代码是 Html: <div class="form-group"> <label for="resourceName" class="col-sm-4 control-label">Enter the Page Name<span>*</span></label> <div class="col-sm-8"

我在一个项目中工作,在这个项目中,我必须从mongod中检索详细信息,并在文本框中提前显示它

我的代码是

Html:

 <div class="form-group">
      <label for="resourceName" class="col-sm-4 control-label">Enter the Page Name<span>*</span></label>
      <div class="col-sm-8">
        <input type="text" class="form-control" name="title" ng-model="selected" typeahead="getPageName()" required>
      </div>
    </div>
但问题是,如果我在文本框中键入,函数根本不会被调用


提前感谢

开始键入后,您可以使用ng change指令调用函数

<input type="text" class="form-control" name="title" ng-model="selected" ng-change="getPageName()" required>


那么,您的typeahead使用的是什么?为什么您的问题同时带有typeahead.js和angular ui typeahead标记?您的标记显然与angular ui typeahead使用的标记不同:
<input type="text" class="form-control" name="title" ng-model="selected" ng-change="getPageName()" required>