Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't bind to 'chart' since it isn't a known property of 'div'. #90

Closed
dice2019 opened this issue Nov 6, 2017 · 11 comments
Closed

Can't bind to 'chart' since it isn't a known property of 'div'. #90

dice2019 opened this issue Nov 6, 2017 · 11 comments

Comments

@dice2019
Copy link

dice2019 commented Nov 6, 2017

use demo in html:
<div [chart]="chart"></div>

use version:
    "@angular/core": "4.3.2",
    "angular-highcharts": "4",
    "@types/highcharts": "^5.0.10",
    "highcharts": "^6.0.2",
@cebor
Copy link
Owner

cebor commented Nov 6, 2017

Can you show your app.module.ts ?

@superestze
Copy link

  • youvshould import the chartModel into app.module.ts or current index.ts

@cebor
Copy link
Owner

cebor commented Nov 8, 2017

Closing this, feel free to reopen!

@cebor cebor closed this as completed Nov 8, 2017
@th0g0th
Copy link

th0g0th commented Nov 11, 2017

@superestze I got a same issue. But I can't find any chartModel here? Can you show me?

@cebor
Copy link
Owner

cebor commented Nov 11, 2017

@th0g0th please post you app.module.ts

@th0g0th
Copy link

th0g0th commented Nov 12, 2017

@cebor I'm using angular-seed.
If i change [chart] to ([chart]), this error will not show. But the highcharts will not display also.

<div ([chart])="chart"></div>

app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { APP_BASE_HREF } from '@angular/common';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

import { AboutModule } from './about/about.module';
import { HomeModule } from './home/home.module';
import { SharedModule } from './shared/shared.module';
import { ChartModule } from 'angular-highcharts';

@NgModule({
  imports: [BrowserModule, HttpModule, AppRoutingModule, AboutModule, HomeModule, ChartModule, SharedModule.forRoot()],
  declarations: [AppComponent],
  providers: [{
    provide: APP_BASE_HREF,
    useValue: '<%= APP_BASE %>'
  }],
  bootstrap: [AppComponent]

})
export class AppModule { }

system.config.js

    packages: {
      highcharts: {
        main: './highcharts.js',
        defaultExtension: 'js'
      },
      'angular-highcharts': {
        main: './angular-highcharts.js',
        defaultExtension: 'js'
      }
    }

@cebor
Copy link
Owner

cebor commented Nov 12, 2017

Appmodule seems to be configured correct.

Maybe you have to import it also in the submodule where you using it within.

@cebor
Copy link
Owner

cebor commented Nov 12, 2017

@th0g0th i see you using systemjs, please try to use ./angular-highcharts.umd.js

@th0g0th
Copy link

th0g0th commented Nov 13, 2017

@Cedor It’s not working.

Maybe you can try using your angular-highcharts on angular-seed to easy to test.

@cebor
Copy link
Owner

cebor commented Nov 13, 2017

@th0g0th if you create a repo where this issue is reproducible i can take look at it.

@nirali-ga
Copy link

Hello,
In your angular App if you have submodules and inside that module's component file if you are trying to implement any chart , you will get above error, but if you import same things and other code as you do in app.module.ts as mentioned in API doc and usage then your problem will get solved.I dont know this is ideal solution or not but I have done this and removed this code from main app.module.ts.

Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants