ng2-ui / auto-complete

Angular Auto Complete component and directive
http://ng2-ui.github.io/auto-complete/
MIT License
279 stars 124 forks source link

Error: (SystemJS) Unexpected value 'undefined' declared by the module 'AppModule' #183

Closed NagaSathya closed 7 years ago

NagaSathya commented 7 years ago

I ma getting below error when i use ng2-typeahead. Error: (SystemJS) Unexpected value 'undefined' declared by the module 'AppModule' In app.html I have below code:

<typeahead
  [(ngModel)]="selectedFruit"
  [list]="fruits"
  [searchProperty]="'searchText'" [displayProperty]="'name'"
  [maxSuggestions]="2"
  (suggestionSelected)="fruitSelected($event)"
  placeholder="Begin typing a fruit">
</typeahead>

app.module.ts:

import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent }  from './app.component';
import { FormsModule } from '@angular/forms';
import { Typeahead } from 'ng2-typeahead';

@NgModule({
  imports:      [ BrowserModule,FormsModule ],
  declarations: [ AppComponent,Typeahead, ],
  bootstrap:    [ AppComponent ]
})

export class AppModule { }

systemjs.config.ts:

  map: {'ng2-typeahead':              'npm:ng2-typeahead/bundles/ng2-typeahead.js',}
packages: {
      app: {
        main: './main.js',
        defaultExtension: 'js'
      },
      rxjs: {
        defaultExtension: 'js'
      },
      'ng2-typeahead': { defaultExtension: 'js' }
    }

In node_modules folder, i have ng2typeahead. Please help me to resolve this.

allenhwkim commented 7 years ago

Please create a plunker example to reproduce this issue. ng2-typeahead is not a part of this project, so without a reproducable example, it's hard to dig into your issue.

allenhwkim commented 7 years ago

This seems nothing related to this module @ngui/auto-complete at all. Closing it.