Open eeerrrttty opened 7 years ago
Please include a URL to the site with the problem (eg a development server)
Have you tried angular material's md-virtual-repeat?
Hello Graingert. I not tried it, i think this wouldn't be a good solution, to work with angular meterial, because it has poor suport to mobile, instead im using materialize and its not so good to mix these things. Your package seems good, im doing something wrong... Sadly we don't have the site online yet, its running at localhost.
Checking other documentations i think my error is in the following:
this.helpers({ posts() { return Posts.find({},{sort: { createdAt: -1 }}); } });
This function will return this.posts, which is in our ngRepeat ->
md-virtual-scroll definitely supports mobile.
Please use angular 1.5 components, isolate scope or controller as ($ctrl in template) when reporting bugs.
If you're creating a new project please start with angular 2 + ng-cli
Here is my code:
HTML:
My controller:
import angular from 'angular'; import angularMeteor from 'angular-meteor'; import template from './wrapPostenviar.html'; import './wrapPostenviar.css'; import { Meteor } from 'meteor/meteor'; import { name as Modals } from '../modals/modals'; import { Posts } from '../../../api/posts'; import { Accounts } from 'meteor/accounts-base'; import ngInfiniteScroll from 'ng-infinite-scroll'; // HERE IS THE IMPORT OF PACKAGE
class WrapPostenviar { constructor($scope, $reactive) { 'ngInject'; $reactive(this).attach($scope); this.file = {}; this.post = {}; this.helpers({ posts() { return Posts.find({},{sort: { createdAt: -1 }}); } }); }
submit() { this.owner = {owner: Meteor.userId()}; this.username = {username: Meteor.users.findOne(Meteor.userId()).username}; this.date = {createdAt: new Date}; this.result = angular.extend(this.post, this.owner, this.username, this.date); Posts.insert(this.result); this.reset(); }
reset() { this.post = {}; } } const name = 'wrapPostenviar'; // create a module export default angular.module(name, [ angularMeteor, 'ui.materialize', ngInfiniteScroll, // HERE IS THE DEPEDENCY Modals // PostEnviar // PostLista ]).component(name, { template, controllerAs: name, controller: WrapPostenviar });