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

Angular UI: Move ChartComponent to @abp/ng.components/chart.js #10082

Merged
merged 14 commits into from Sep 21, 2021
Merged

Conversation

mehmet-erim
Copy link
Contributor

@mehmet-erim mehmet-erim commented Sep 20, 2021

Resolves #7472

Chart.js is lazy-loaded by @abp/theme.shared after app initialization (before v5.0). Loading the chart.js is redundant if you don't use the ChartComponent. So we handled this case and decided to move ChartComponent to another package (@abp/ng.components/chart.js). As of v5.0, if you do not import ChartModule, the chart.js script will not be loaded.

In this PR, there are some changes that may break your app:

  • You should import the ChartModule to use the abp-chart as shown below:
import { ChartModule } from '@abp/ng.components/chart.js';

@NgModule({ 
  imports: [
    ChartModule,
    // ...
  ],
  // ...
})

export class YourFeatureModule { }
  • chartJsLoaded$ subject has been removed
  • getRandomBackgroundColor function moved to @abp/ng.components/chart.js

Usage of the ChartComponent document will be added. (#10083)

@mehmet-erim mehmet-erim merged commit 889d266 into dev Sep 21, 2021
@mehmet-erim mehmet-erim deleted the feat/7472 branch September 21, 2021 07:06
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

Successfully merging this pull request may close these issues.

Angular - Chart.js big include with CommonJS warning
3 participants