我正在尝试使用ember-infinity实现无限滚动。
我只关注了文档,但是我收到了错误
"找不到模块ember-infinity/mixins/route
"
以下是我的代码
import Ember from 'ember';
import InfinityRoute from 'ember-infinity/mixins/route';
export default Ember.Route.extend(InfinityRoute,{
store: Ember.inject.service(),
model(){
var inflector = Ember.Inflector.inflector;
inflector.irregular('feed', 'feeds.php');
inflector.uncountable('advice');
let user = JSON.parse(localStorage.getItem('user'));
let token = localStorage.getItem('token');
if(user != null){
//return this.get('store').query('feed',{page:1,userid:user.id,token:token});
return this.infinityModel("feed", { perPage: 12, startingPage: 1,userid:user.id,token:token });
}
} ,
actions:{
getDetails(feed){
console.log("Getting details of "+feed.id);
}
}
});
您能否告诉我导致此错误的原因或任何可以使用ember js教授无限滚动的教程?
答案 0 :(得分:2)
安装后不要忘记重启ember-cli。