We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can not use ej angular2 components

Hello! I'm using the angular2 components and I'm facing a error is when I import ej components in app.modult.ts and will occur error like:" Cannot set property 'backGroundImageUrl' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot set property 'backGroundImageUrl' of undefined" if I import the chart components.and here's the code:

import { NgModule } from "@angular/core";
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { HttpModule, RequestOptions } from "@angular/http";
import { AppRequestOptions } from "./app.request";

import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";

import { EJ_CHART_COMPONENTS } from "./ej/chart.component";

    imports: [
    declarations: [
    providers: [
        { provide: RequestOptions, useClass: AppRequestOptions }
    bootstrap: [AppComponent]
export class AppModule { }

And My folder strucrure is like:

If I remove the import ej component part from app.module.ts then it works.
Is there any extra files I need to include?Thanks

1 Reply

AS Abinaya Subbiah Syncfusion Team January 4, 2017 05:19 AM UTC

Hi Jemmy,  
Thanks for contacting Syncfusion support. 
The script error “Cannot set property ‘backGroundImageUrl’ of undefined(…)” due to mismatching versions of npm packages. Since, the Syncfusion JavaScript components supports Angular 2 final release version 2.0.0 , so we suggest you to use Angular 2 packages from final release version “2.0.0”.  
We already consider this  as feature request “Upgrade Syncfusion Angular 2 components to Angular v2.2.0”, it will be included in our Essential studio 2017 Volume 1 release, which is expected to be rolled out by 7th February, 2017. We appreciate your patience until then.  
We have also implemented seed applications, to quick-start with Syncfusion JavaScript Angular 2 components. Refer to the below documentation link for getting started with seed application.  
We also implemented Angular 2 sample browser using our JavaScript Angular 2 components. 
Please revert us back if you need further assistance on this.  
Abinaya S  

Live Chat Icon For mobile
Up arrow icon