-
Notifications
You must be signed in to change notification settings - Fork 160
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
How to integrate devextreme-angular2 witch WebPack #150
Comments
I aslo have issue with webpack. I got the following error: Uncaught Error: Unexpected value 'DevExtremeModule' imported by the module 'AppModule' DevExtremeModule seems to be in the webpack generated file. Any idea? |
I have the same issue |
The original issue is no more present with the new version 16.1.7 released yesterday. Any suggestion? |
See #135 . -> Add dx.all.js to your vendor or the script to index.html It works for you now because i suppose you were pointing a superior version of angular and not 2.0.0. This release is compatible with ^2.0.0 |
It worked! thanks! |
I am glad to inform you that we have added support for TypeScript modules definition in DevExtreme
|
@Aden-git
npm uninstall jquery --save And in angular-cli.json It works now! |
Hello @bobby77 Thank you for your suggestion. We have a lot of questions related to integration with the webpack and are planning to add examples and tutorials to our documentation. |
Any updates on examples/tutorials with webpack? I've followed what is mentioned here and while I have a devexpress button and grid(with search,sorting etc.) working, I can't get any js calls working like DevExpress.ui.dialog etc. I always get DevExpress is undefined. I've tried numerous things with no luck so far in webpack.config.vendor.js to try and expose the DevExpress calls.(I don't really want to add it inside |
Below I'll try to provide you with a general guide on how to add DevExtreme to an Angular 2 application that uses webpack. If you don't have an existing application, you can use one of a number of Angular 2 webpack-based starters and guides. Install the devextreme-angular npm package npm install devextreme-angular --save Add DevExtreme modules to an Angular 2 application Go to your main .ts file and import the required modules to your app: ...
import { DevExtremeModule } from 'devextreme-angular';
@NgModule({
...
imports: [
...
DevExtremeModule,
...
]
})
export class AppModule {} Configure webpack loaders for DevExtreme stylesheets Go to webpack.config.js and configure loaders for css and fonts as follows: ...
loaders: [
...
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.(ttf|eot|woff)$/, loader: "file-loader?name=/[name].[ext]" }
]
... It might happen that they are already configured or partially configured in your webpack config. You just need to make sure that all the necessary extensions are processed by the corresponding loaders as described above. Also, make sure that style-loader, css-loader and file-loader are installed into your project as npm dev dependencies. Otherwise, please install them. Import DevExtreme stylesheets Having loaders configured, you need to import the required DevExtreme css files. Go to your main .ts file and import the stylesheets as follows: ...
import 'devextreme/dist/css/dx.common.css';
import 'devextreme/dist/css/dx.dark.css'; After that, you should be able to use DevExtreme Angular 2 components in your application. Server-side rendering Currently, DevExtreme components do not support server side rendering (check this issue). So, you need to switch this feature off. |
You can find an example for how to use devextreme-angular with Webpack on my GitHub repository: GoshaFighten/Angular2DXWebpack. My project is based on the Webpack tutorial from the Angular docs. |
@GoshaFighten I am having a similar issue. I have a ticket open here but I thought I should ask here too. In the installation instructions for devextreme-angular for Webpack usage I'm at this section but I already have an existing loaders section:
I think I need to add these two rules as the instructions say or else I get the errors as my ticket explains. What do I need to do to make this work? |
Hello!
Tell me how you can integrate devextreme-angular2 witch WebPack?
I'm trying to add dx-data-grid
Can you help me with error:
main.bundle.js:332 Error: Template parse errors:(…)(anonymous function)
@ main.bundle.js:332ZoneDelegate.invoke
@ zone.js:203Zone.run
@ zone.js:96(anonymous function)
@ zone.js:462ZoneDelegate.invokeTask
@ zone.js:236Zone.runTask
@ zone.js:136drainMicroTaskQueue
@ zone.js:368
The text was updated successfully, but these errors were encountered: