Code Monkey home page Code Monkey logo

Comments (21)

orizens avatar orizens commented on August 16, 2024

hi.
I guess the project you're using doesn't compile modules from "node_modules" directory.
I'm working on publishing a es5 compiled code so it will work flawlessly.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

@ocombe, care to help me wiring this module so it can be consumed as expected via npm?
I followed your article, but am getting error.

from ngx-infinite-scroll.

ocombe avatar ocombe commented on August 16, 2024

Sure, but I see a lot of stuff missing here:
no .gitignore, no .npmignore, no angular2-infinite-scroll.ts file at the root, no tsconfig.json, no angular peerDepedency in the package.json, no prepublish script, no typescript compiler.
Are you sure that you followed the article?

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

Hi @ocombe
I just pushed my latest changes.
One difference is that i put an index.js in the root - so the actual angular2-infinite-scroll.ts is in the 'src' directory.

from ngx-infinite-scroll.

ocombe avatar ocombe commented on August 16, 2024

Is there a reason for that ?
It means that people will have to consume your library from "angular2-infinite-scroll/src/infinite-scroll".

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

no reason.
I followed a non-typescript convention.

from ngx-infinite-scroll.

ocombe avatar ocombe commented on August 16, 2024

Ok, and is it ok with you that people import from "angular2-infinite-scroll/src/infinite-scroll" ? If so I think that you should remove the index.js at the root which doesn't do anything and then it should work.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

i pushed another update - 20ac4af
updated the root to follow ng2-translate.
however - i'm still getting errors.

screen shot 2016-02-08 at 12 16 16 pm

from ngx-infinite-scroll.

ocombe avatar ocombe commented on August 16, 2024

I just tested it myself and it works.
I think that this error looks like an error from your webpack config, not from the module in itself. It tries to load the js files with the ts loader.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

yes - i'm trying it in Echoes project - https://github.com/orizens/echoes-ng2
and indeed - there's a ts-loader for ts files.
Do i need to specify a js-loader for js files?

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

I'm also getting a lot of duplicated "X" in console for d.ts files:

error TS2300: Duplicate identifier 'prototype'.

from ngx-infinite-scroll.

ocombe avatar ocombe commented on August 16, 2024

The duplicate errors comes from the fact that you're probably using npm link, they will go away once you really install from npm.
Thinking of it it's probably the same error for the ts-loader, since you're using npm link it will import the ts files from your repository instead of the js files.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

well, i managed to solve it.
i unlink the npm, installed the latest version from npm (currently with your guidance - updated to 0.0.3) and it works as expected now.

in contrary to using:

import { InfiniteScroll } from 'angular2-infinite-scroll/angular2-infinite-scroll';

this directive can be consumed by:

import { InfiniteScroll } from 'angular2-infinite-scroll';

that is possible because of the "main" property in the package.json pointing as the root file.

@ocombe Thanks for assisting me :)
@prolink007 thanks for reporting - you can try now the directive - please note that only some of its original features are implemented now.

from ngx-infinite-scroll.

ocombe avatar ocombe commented on August 16, 2024

Ahh good to know for the "main" property, I gotta try that.

from ngx-infinite-scroll.

prolink007 avatar prolink007 commented on August 16, 2024

@orizens Updated to 0.0.3 and made the import change. It is still not scrolling with this implementation.

<div
     infinite-scroll
     [infiniteScrollDistance]="2"
     (scroll)="onScroll()">
    some stuff<br>
    asdfjasdk<br>
    asdfasdfa<br>
    dfasdfasdf<br>
    asdfasdfasd<br>
    fasdfasdfa<br>
    sdfasdfasdf<br>
    asdfadfadf<br>
    some stuff<br>
    asdfjasdk<br>
    asdfasdfa<br>
    dfasdfasdf<br>
    asdfasdfasd<br>
    fasdfasdfa<br>
    sdfasdfasdf<br>
    asdfadfadf<br>
    some stuff<br>
    asdfjasdk<br>
    asdfasdfa<br>
    dfasdfasdf<br>
    asdfasdfasd<br>
    fasdfasdfa<br>
    sdfasdfasdf<br>
    asdfadfadf<br>
    some stuff<br>
    asdfjasdk<br>
    asdfasdfa<br>
    dfasdfasdf<br>
    asdfasdfasd<br>
    fasdfasdfa<br>
    sdfasdfasdf<br>
    asdfadfadf<br>
    some stuff<br>
    asdfjasdk<br>
    asdfasdfa<br>
    dfasdfasdf<br>
    asdfasdfasd<br>
    fasdfasdfa<br>
    sdfasdfasdf<br>
    asdfadfadf<br>
</div>

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

hi @prolink007
it should be used as explained in the following http://sroze.github.io/ngInfiniteScroll/demo_basic.html
have a look at a working example with angular2 here - https://plnkr.co/edit/fh35HTLFP2uG8vcjcIe0?p=preview

from ngx-infinite-scroll.

prolink007 avatar prolink007 commented on August 16, 2024

@orizens The first link is for the old infinite scroll and is with an older version of angular. The second link does not infinitely scroll. It would be great if you could provide a couple examples with your library. A jsfiddle or something would be very good.

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

hi.
It does scroll - i updated the example - https://plnkr.co/edit/fh35HTLFP2uG8vcjcIe0?p=preview

from ngx-infinite-scroll.

prolink007 avatar prolink007 commented on August 16, 2024

@orizens I just tested your plnkr again.

I agree, it is scrolling. However, it is not infinitely scrolling. If i my scroll bar is at the bottom of the list and i attempt to continue scrolling, it does not continue to create content and scroll.

from ngx-infinite-scroll.

suresh121 avatar suresh121 commented on August 16, 2024

@orizens For me it is working for any div with fixed height. But it does not trigger the callback when I try window scroll.

I have also tried setting [scrollWindow]="true" explicitly but not luck. I am using Angular 2.1.0 and angular2-inifinite-scroll 0.2.8

Any idea?

from ngx-infinite-scroll.

orizens avatar orizens commented on August 16, 2024

hi @suresh121
please look at the demo https://plnkr.co/edit/DrEDetYnZkFxR7OWWrxS?p=preview

from ngx-infinite-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.