当用户在自动完成框中键入电影名称时,我正在使用此代码搜索电影。我在控制台上得到结果,但没有显示项目文本 Html
<md-autocomplete md-selected-item="selectedMovie"
md-search-text-change="searchMovie(searchText)"
md-search-text="searchText"
md-selected-item-change="selectedItemChange(movie)"
md-items="movie in movies"
md-item-text="movie.title"
md-min-length="1"
placeholder="Search Movies">
<md-item-template>
<span md-highlight-text="searchText" md-highlight-flags="^i">
{{movie.title}}
</span>
</md-item-template>
<md-not-found>
No Movies matching were found.
</md-not-found>
</md-autocomplete>
JS
$scope.searchMovie = function (text) {
$http.get('api/movie', {
params: {
searchMovieName: text
}
}).success(function (data, status) {
console.log(data.results);
console.log(status);
$scope.movies = data.results;
}).error(function (err) {
console.log(err);
});
};