question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

http://localhost:3000/node_modules/ng2-pagination/ 404 (Not Found)

See original GitHub issue

I get this error:

I have tried taking help of this link: https://github.com/michaelbromley/ng2-pagination/issues/44 I have included necessary lines of code as suggested by scottmizo in this link i.e in my systemjs.config.js

System.config({ 
  map: {
    'ng2-pagination': 'node_modules/ng2-pagination'
  }, 
  packages: {
   'ng2-pagination ':  { main: 'index.js', defaultExtension: 'js'} 
  }
)

in my app.module.ts import {PaginationControlsCmp, PaginatePipe, PaginationService} from ‘ng2-pagination’;

@NgModule({
    imports: [
        BrowserModule,
        FormsModule, 
        routing,
        HttpModule,
        JsonpModule,
        ReactiveFormsModule,
        DndModule.forRoot()
    ],

    exports: [
        BrowserModule,
        DndModule
    ],

    declarations: [
        AppComponent,
        NavBarComponent,
        NavDecorateComponent,
        ContentComponent,
        LoginComponent,
        FavouriteComponent,
        HomeComponent,
        NavBar3Component,
        DefaultProjectComponent,
        DashboardComponent,
        NavBar2Component,
        FilterComponent,
        IssuestatusComponent,
        TrackerComponent,
        FooterComponent,
        PaginationControlsCmp,
        PaginatePipe
    ],

    providers: [

        HTTP_PROVIDERS,
        TokenService,
        ProjectService,
        ValueService,
        PaginationService


    ],



    bootstrap: [
        AppComponent
    ]
})
export class AppModule { }

then in the component:

import {PaginatePipe, PaginationControlsCmp, PaginationService} from 'ng2-pagination';

@Component({
  selector: 'dashboard',
  templateUrl: 'app/templates/dashboard.component.html',
  providers: [CookieService, ProjectService, TokenService, PaginationService],
  directives: [PaginationControlsCmp],
  pipes: [PaginatePipe]
})

But error 404 still persists.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
amanullahnxbcommented, Oct 24, 2016

My error GET http://localhost:3000/node_modules/ng2-pagination/ 404 (Not Found)

resolved using…

//systemjs.config.js `System.config({ map: { ‘ng2-pagination’: ‘node_modules/ng2-pagination’ },

packages: { ‘ng2-pagination’: { main: ‘index.js’, defaultExtension: ‘js’} //The was an extra space here } )`

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//app.moduls.ts import {Ng2PaginationModule} from ‘ng2-pagination’; // <-- import the module

imports: [ ...., Ng2PaginationModule, ..... ],

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//template.component.html `

  • content ...
<pagination-controls (pageChange)="p = $event"></pagination-controls> `
1reaction
alejandrocodingcommented, Oct 11, 2016

Use this: import {Ng2PaginationModule} from 'ng2-pagination'; // <-- import the module

instead of the components/services:

import {PaginationControlsCmp, PaginatePipe, PaginationService} from 'ng2-pagination';

Within the ngModule of the component where you need the pagination.

Read more comments on GitHub >

github_iconTop Results From Across the Web

404 Not found · Issue #44 · michaelbromley/ngx-pagination
I followed the installation guide, however I am getting the following error: (index):46 Error: Error: XHR error (404 Not Found) loading ...
Read more >
Failed to load resource: the server responded with a status ...
app.min.js:3 GET http://localhost:3000/node_modules/@angular/common/ ... 404 (Not Found) (index):33 Error: Error: XHR error (404 Not Found) ...
Read more >
Javascript – Angular2 require is not defined for libraries in ...
I am using angular2-seed as a seed for my project. The require is working perfectly fine in source files. But whenever I include...
Read more >
WordPress /page/2 404 pagination problem - what to do?
I will answer this question and provide the link. Simply changing the pagination parameter from "paged" to "page" fixed the issue in my...
Read more >
Alfresco/alfresco-ng2-components
ERROR in /home/mikel/workspaces/bee/2017-global-hackaton/test-ng2-component/node_modules/ng2-alfresco-core/src/components/pagination/pagination.module.ts
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found