amit shukla

amit shukla

  • NA
  • 78
  • 65.1k

Unexpected token < error on angular 4

Apr 25 2018 2:15 AM
Hi Friends,
 
Error : Unexpected token <.
 

I want use infinite scroll in my angular 4 project. but when i installed it then it will give "Unexpected token <" error.

I am explaingin what is the step.

  • install inifint scroll like npm install ngx-infinite-scroll
  • Next add infinit scroll on my module give below

import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

import { InfiniteScrollModule } from "ngx-infinite-scroll";

@NgModule({

imports: [BrowserModule, ReactiveFormsModule, HttpModule, FormsModule, InfiniteScrollModule],

declarations: [AppComponent],

providers: [{ provide: APP_BASE_HREF, useValue: '/' }],

bootstrap: [AppComponent]

})

export class AppModule { }

· And add in systemjs.config file like this

'ngx-infinite-scroll': 'npm:ngx-infinite-scroll/bundles/ngx-infinite-scroll.umd.js',

But when I run my application then it will give error

Unexpected token >

If I write “'ngx-infinite-scroll': 'npm:ngx-infinite-scroll” then it gives different error given below.

Error loading http://localhost:51430/node_modules/ngx-infinite-scroll as "ngx-infinite-scroll" from http://localhost:51430/app/app.module.js

Plz resolve this. 


Answers (1)