You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+93-8Lines changed: 93 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -259,25 +259,110 @@ Component methods can be called by accessing the component from the view. For ex
259
259
template: '<ig-grid #grid1
260
260
[(options)]="gridOptions">
261
261
<features>
262
-
<paging [pageSize]="'2'"></paging>
263
-
</features>
262
+
<paging [pageSize]="'2'"></paging>
263
+
</features>
264
264
</ig-grid>',
265
265
directives: [IgGridComponent]
266
266
})
267
-
export class AppComponent {
268
-
private gridOptions: IgGrid;
269
-
@ViewChild("grid1") myGrid: IgGridComponent;
267
+
export class AppComponent {
268
+
private gridOptions: IgGrid;
269
+
@ViewChild("grid1") myGrid: IgGridComponent;
270
270
private id: string;
271
271
constructor() { ... }
272
272
273
-
ngAfterViewInit() {
274
-
//call grid method
275
-
var cell = this.myGrid.cellById(1, "Name");
273
+
ngAfterViewInit() {
274
+
//call grid method
275
+
var cell = this.myGrid.cellById(1, "Name");
276
276
//call grid paging method
277
277
this.myGrid.featuresList.paging.pageIndex(2);
278
278
}
279
279
}
280
280
281
+
## Using Ignite UI Angular Components inside AOT app
282
+
As a starting point, you can review the [Angular documentation on the subject](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html), which provides a guide how to compile an app with AOT. Follow their instructions to AOT compile the quickstart app.
283
+
284
+
Once you have a running application compiled with AOT, the next step is to add the Ignite UI Components into this app. In this demo IgComboComponent is being added to the app, igCombo is an OSS widget and it is part of the ignite-ui npm package.
285
+
First we need to install the required packages:
286
+
-`npm install ignite-ui`
287
+
-`npm install igniteui-angular2`
288
+
-`npm install jquery-ui-bundle`
289
+
290
+
**Note**: You have to download the full Ignite UI product if you would like to use widgets which are not part of the OSS widgets. This is a [list](https://github.com/IgniteUI/ignite-ui#available-features-in-ignite-ui-open-source-version) of the controls available in the Open-source version
291
+
292
+
Then go to the app module and import the combo - `import 'ignite-ui/js/modules/infragistics.ui.combo.js';`. But before that add all the dependencies for it:
In addition, at the end import the IgniteUIModule:
302
+
303
+
import { IgniteUIModule } from 'igniteui-angular2';
304
+
@NgModule({
305
+
imports: [ BrowserModule, IgniteUIModule ],
306
+
…
307
+
})
308
+
export class AppModule {}
309
+
310
+
In order to take advantage of the [Tree shaking](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#tree-shaking) the Rollup has to be set up.
311
+
Open rollup-config.js, include igniteui-angular2 to `commonjs` plugin and add `namedExport` for jquery:
Additional plugin rollup-plugin-replace should be installed
323
+
`npm install rollup-plugin-replace` in order to fix the offline compilation of Ignite UI util module.
324
+
`this.Class` should be changed to `window.Class`, because the offline compilation is not having the same [context and this is changed to undefined](https://github.com/rollup/rollup/issues/942).
325
+
326
+
replace({
327
+
// this is undefined for the specified context, so replace it with window to access Class
At the end, apply Ignite UI styling. To achieve this, postcss plugin should be installed
348
+
`npm install rollup-plugin-postcss`
349
+
350
+
Open rollup-config.js file and import postcss:
351
+
352
+
import postcss from 'rollup-plugin-postcss'
353
+
…
354
+
postcss({
355
+
extensions: ['.css']
356
+
}),
357
+
358
+
359
+
[Download](https://github.com/IgniteUI/igniteui-angular2/files/975676/quickstart-igniteui-angular2-aot.zip) the modified app which uses the specified product. To run it with AOT:
360
+
1. npm install
361
+
2. npm run build:aot
362
+
3. npm run serve
363
+
364
+
365
+
281
366
## Two-way Data Binding
282
367
The following controls currently support two-way data binding:
0 commit comments