How do i load 10 objects from a mongoose array multiple times and keep the previously loaded...

Discussão em 'Angular' iniciado por Jango, Novembro 25, 2024.

  1. Jango

    Jango Guest

    I basically have posts with an image and title. I want to load 10 posts initially. Then when you scroll down past them you can click a 'show more posts' button to load the next 10 and be able to keep doing that. So i dont know if its exactly like pagination because its all on one page and i want to keep the previous posts loaded. Im using angular and right now my app is working with a basic 'find' request which returns all the posts.

    router.get(
    "/",
    asyncHandler(async (req, res) => {
    const posts = await PostModel.find().sort({ createdAt: "descending" });
    res.send(posts);
    })
    );

    Continue reading...

Compartilhe esta Página