Skip to content

Commit 50c8ed5

Browse files
committed
Merge remote-tracking branch 'refs/remotes/IgniteUI/master'
2 parents 08ebc08 + ff9b738 commit 50c8ed5

File tree

127 files changed

+11787
-164576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+11787
-164576
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ samples/**/*.d.ts
4444
samples/**/*.js
4545
samples/**/*.js.map
4646

47-
src/igniteui.angular2.d.ts
48-
src/*.js
49-
src/*.js.map
47+
src/**/*.d.ts
48+
src/**/*.js
49+
src/**/*.js.map
50+
src/**/*.metadata.json
5051

5152
tests/unit/**/*.d.ts
5253
tests/unit/**/*.js

ISSUE_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
### Description
2+
Describe the issue.
3+
4+
### Steps to reproduce
5+
6+
1. Step 1
7+
2. Step 2
8+
3. ...
9+
10+
### Result
11+
What is the actual result after following the steps to reproduce?
12+
13+
### Expected result
14+
What is the expected result after following the steps to reproduce?
15+
16+
17+
### Attachments
18+
Attach a sample if available, and screenshots, if applicable.

README.md

Lines changed: 174 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#Ignite UI components for Angular 2
1+
# Ignite UI components for Angular
22

3-
[![NPM version](https://img.shields.io/npm/v/igniteui-angular2.svg?style=flat)](https://www.npmjs.com/package/igniteui-angular2)
43
[![Build Status](https://travis-ci.org/IgniteUI/igniteui-angular2.svg?branch=master)](https://travis-ci.org/IgniteUI/igniteui-angular2)
5-
[![Coverage Status](https://coveralls.io/repos/github/IgniteUI/igniteui-angular2/badge.svg?branch=master)](https://coveralls.io/github/IgniteUI/igniteui-angular2?branch=master)
4+
[![Coverage Status](https://coveralls.io/repos/github/IgniteUI/igniteui-angular2/badge.svg?branch=master)](https://coveralls.io/github/IgniteUI/igniteui-angular2?branch=master)
5+
[![NPM version](https://img.shields.io/npm/v/igniteui-angular2.svg?style=flat)](https://www.npmjs.com/package/igniteui-angular2)
66

7-
Use the components found in `src\igniteui.angular2.ts` to use [Ignite UI](http://igniteui.com) controls in [Angular 2](https://angular.io/) applications. [Work with the running samples here](http://igniteui.github.io/igniteui-angular2).
7+
Use the components found in `src\igniteui.angular2.ts` to use [Ignite UI](http://igniteui.com) controls in [Angular](https://angular.io/) applications. [Work with the running samples here](http://igniteui.github.io/igniteui-angular2).
88

9-
#Requirements
9+
# Requirements
1010

1111
- [jQuery](http://www.jquery.com) v1.9.1 and later
1212
- [jQuery UI](http://www.jqueryui.com) v1.9.0 and later
13-
- [AngularJS 2](https://angular.io/) v2.0 beta and later
13+
- [Angular](https://angular.io/) v2.0 beta and later
1414
- [Ignite UI](http://www.igniteui.com) 15.2 and later
1515

16-
#Running the samples
16+
# Running the samples
1717
To run the samples, you need [Node.js](http://nodejs.org/) installed on your machine.
1818
Afterwards, from your terminal run the following commands:
1919

@@ -22,10 +22,18 @@ Afterwards, from your terminal run the following commands:
2222
3. `npm install`
2323
4. `npm start`
2424

25-
#Getting Started
25+
`igniteui-angular2` depends on the `ignite-ui-full` licensed package. Follow [this guide](https://www.igniteui.com/help/using-ignite-ui-npm-packages) on setting up access to the Ignite UI private npm feed and add the dependency to the `package.json`.
26+
27+
```
28+
"dependencies": {
29+
"@infragistics/ignite-ui-full": "latest"
30+
}
31+
```
32+
33+
# Getting Started
2634

2735
## Initializing controls
28-
In an Angular 2 application, Ignite UI controls support markup initialization which is done by using custom tags.
36+
In an Angular application, Ignite UI controls support markup initialization which is done by using custom tags.
2937

3038
### Custom tags
3139
Each control implements a custom tag component where the tag name is formed by splitting each capital letter in the control name with the `-` symbol.
@@ -64,8 +72,7 @@ There are two mandatory attributes that need to be set to an Ignite UI control c
6472
selector: 'my-app',
6573
template: `<ig-grid
6674
[(options)]="gridOptions"
67-
[(widgetId)]='id'></ig-grid>`,
68-
directives: [IgGridComponent]
75+
[(widgetId)]='id'></ig-grid>`
6976
})
7077
export class AppComponent {
7178
private gridOptions: IgGrid;
@@ -104,8 +111,7 @@ when there are overlapping properties. Also changing top-level attribute will ap
104111
[height]='h'
105112
[autoGenerateColumns]='true'
106113
>
107-
</ig-grid>`,
108-
directives: [IgGridComponent]
114+
</ig-grid>`
109115
})
110116
export class AppComponent {
111117
private id: string;
@@ -123,7 +129,51 @@ when there are overlapping properties. Also changing top-level attribute will ap
123129
}
124130
}
125131

126-
### Aply new set of Control Options
132+
### Other custom tags
133+
134+
There are two custom tags `<column>` and `<features>` that are used in igGrid/igTreeGrid/igHierarchicalGrid to configure the `columns` and `features` options accordingly.
135+
136+
#### Example:
137+
138+
<ig-grid [widgetId]='id'>
139+
<column [key]="'ProductID'" [headerText]="'Product ID'" [width]="'165px'" [dataType]="'number'"></column>
140+
<column [key]="'ProductName'" [headerText]="'Product Name'" [width]="'250px'" [dataType]="'string'"></column>
141+
<column [key]="'QuantityPerUnit'" [headerText]="'Quantity per unit'" [width]="'250px'" [dataType]="'string'"></column>
142+
<column [key]="'UnitPrice'" [headerText]="'Unit Price'" [width]="'100px'" [dataType]="'number'"></column>
143+
<features>
144+
<paging [pageSize]="currPageSize"></paging>
145+
<filtering></filtering>
146+
<selection></selection>
147+
<group-by></group-by>
148+
</features>
149+
</ig-grid>
150+
151+
Each of the grids features is also represented by a custom tag.
152+
153+
#### Examples:
154+
155+
| Feature Name | Tag |
156+
|--------------------|---------------------------|
157+
| ColumnMoving | `<column-moving>` |
158+
| Filtering | `<filtering>` |
159+
| GroupBy | `<group-by>` |
160+
| Hiding | `<hiding>` |
161+
| CellMerging | `<cell-merging>` |
162+
| AppendRowsOnDemand | `<append-rows-on-demand>` |
163+
| MultiColumnHeaders | `<multi-column-headers>` |
164+
| Paging | `<paging>` |
165+
| Responsive | `<responsive>` |
166+
| Resizing | `<resizing>` |
167+
| RowSelectors | `<row-selectors>` |
168+
| Selection | `<selection>` |
169+
| Sorting | `<sorting>` |
170+
| Summaries | `<summaries>` |
171+
| ColumnFixing | `<column-fixing>` |
172+
| Tooltips | `<tooltips>` |
173+
| Updating | `<updating>` |
174+
175+
176+
### Apply new set of Control Options
127177

128178
In order to change the more options at once (or recreate the component with another set of options), the new configuration can be applied to the `options` property.
129179

@@ -133,8 +183,7 @@ In order to change the more options at once (or recreate the component with anot
133183
selector: 'my-app',
134184
template: `<ig-grid
135185
[(options)]="gridOptions"
136-
[(widgetId)]='id'></ig-grid>`,
137-
directives: [IgGridComponent]
186+
[(widgetId)]='id'></ig-grid>`
138187
})
139188
export class AppComponent {
140189
private gridOptions: IgGrid;
@@ -186,8 +235,7 @@ Binding to control events is achieved by assigning attributes where the name of
186235
template: `<ig-grid
187236
[(options)]="gridOptions"
188237
[(widgetId)]='id'
189-
(dataBind)="dataBindHandler($event)"></ig-grid>`,
190-
directives: [IgGridComponent]
238+
(dataBind)="dataBindHandler($event)"></ig-grid>`
191239
})
192240
export class AppComponent {
193241
private gridOptions: IgGrid;
@@ -219,8 +267,7 @@ Binding to igGrid* feature events is done in the control's configuration code.
219267
selector: 'my-app',
220268
template: `<ig-grid
221269
[(options)]="gridOptions"
222-
[(widgetId)]='id'></ig-grid>`,
223-
directives: [IgGridComponent]
270+
[(widgetId)]='id'></ig-grid>`
224271
})
225272
export class AppComponent {
226273
private gridOptions: IgGrid;
@@ -259,25 +306,109 @@ Component methods can be called by accessing the component from the view. For ex
259306
template: '<ig-grid #grid1
260307
[(options)]="gridOptions">
261308
<features>
262-
<paging [pageSize]="'2'"></paging>
263-
</features>
264-
</ig-grid>',
265-
directives: [IgGridComponent]
309+
<paging [pageSize]="'2'"></paging>
310+
</features>
311+
</ig-grid>'
266312
})
267-
export class AppComponent {
268-
private gridOptions: IgGrid;
269-
@ViewChild("grid1") myGrid: IgGridComponent;
313+
export class AppComponent {
314+
private gridOptions: IgGrid;
315+
@ViewChild("grid1") myGrid: IgGridComponent;
270316
private id: string;
271317
constructor() { ... }
272318
273-
ngAfterViewInit() {
274-
//call grid method
275-
var cell = this.myGrid.cellById(1, "Name");
319+
ngAfterViewInit() {
320+
//call grid method
321+
var cell = this.myGrid.cellById(1, "Name");
276322
//call grid paging method
277323
this.myGrid.featuresList.paging.pageIndex(2);
278324
}
279325
}
280326

327+
## Using Ignite UI Angular Components inside AOT app
328+
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.
329+
330+
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.
331+
First we need to install the required packages:
332+
- `npm install ignite-ui`
333+
- `npm install igniteui-angular2`
334+
- `npm install jquery-ui-bundle`
335+
336+
**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
337+
338+
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:
339+
340+
import 'jquery';
341+
import 'jquery-ui-bundle/jquery-ui.min.js';
342+
import 'ignite-ui/js/modules/infragistics.util.js';
343+
import 'ignite-ui/js/modules/infragistics.templating.js';
344+
import 'ignite-ui/js/modules/infragistics.datasource.js';
345+
import 'ignite-ui/js/modules/infragistics.ui.combo.js';
346+
347+
In addition, at the end import the IgniteUIModule:
348+
349+
import { IgniteUIModule } from 'igniteui-angular2';
350+
@NgModule({
351+
imports: [ BrowserModule, IgniteUIModule ],
352+
353+
})
354+
export class AppModule {}
355+
356+
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.
357+
Open rollup-config.js, include igniteui-angular2 to `commonjs` plugin and add `namedExport` for jquery:
358+
359+
commonjs({
360+
include: ['node_modules/rxjs/**',
361+
'node_modules/igniteui-angular2/**',
362+
],
363+
namedExports: {
364+
'node_modules/jquery/dist/jquery.min.js': [ 'jquery' ]
365+
}
366+
}),
367+
368+
Additional plugin rollup-plugin-replace should be installed
369+
`npm install rollup-plugin-replace` in order to fix the offline compilation of Ignite UI util module.
370+
`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).
371+
372+
replace({
373+
// this is undefined for the specified context, so replace it with window to access Class
374+
include: 'node_modules/ignite-ui/js/modules/infragistics.util.js',
375+
values: { 'this.Class': 'window.Class' }
376+
}),
377+
378+
Now we are ready to use the IgComboComponent
379+
`<ig-combo [dataSource]="heroesCombo" [widgetId]="comboId" [textKey]="'name'" [valueKey]="'id'"></ig-combo>` in app.component.html
380+
And also define the used properties in AppComponent class:
381+
382+
export class AppComponent {
383+
comboId = 'combo1';
384+
showHeading = true;
385+
heroes = ['Magneta', 'Bombasto', 'Magma', 'Tornado'];
386+
heroesCombo = [{id: 0, name: 'Magneta'}, {id: 1, name:'Bombasto'}, {id: 2, name:'Magma'}, {id: 3, name:'Tornado'}];
387+
388+
toggleHeading() {
389+
this.showHeading = !this.showHeading;
390+
}
391+
}
392+
393+
At the end, apply Ignite UI styling. To achieve this, postcss plugin should be installed
394+
`npm install rollup-plugin-postcss`
395+
396+
Open rollup-config.js file and import postcss:
397+
398+
import postcss from 'rollup-plugin-postcss'
399+
400+
postcss({
401+
extensions: ['.css']
402+
}),
403+
404+
405+
[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:
406+
1. npm install
407+
2. npm run build:aot
408+
3. npm run serve
409+
410+
411+
281412
## Two-way Data Binding
282413
The following controls currently support two-way data binding:
283414

@@ -288,6 +419,18 @@ The following controls currently support two-way data binding:
288419
5. igEditors
289420
6. igTree
290421

422+
## Use igDataSource inside Angular app
423+
424+
Thanks to the @types/ignite-ui, it is possible to create an instace of the all of the Ignite UI data sources.
425+
426+
let source = new Infragistics.DataSource(settings);
427+
428+
This data source instance is granted with intellisense about igDataSource methods.
429+
430+
source.dataBind();
431+
432+
Review the following [demo](http://igniteui.github.io/igniteui-angular2/samples/igDataSource/igDataSource.html) for more information.
433+
291434
## Running tests
292435

293436
The command for running the tests is:
@@ -303,7 +446,7 @@ Since we need the code coverage of the `igniteui.angular2.js` file itself, we us
303446

304447
---------------------------------------
305448

306-
##What is Ignite UI?
449+
## What is Ignite UI?
307450
[![Ignite UI Logo](http://infragistics-blogs.github.io/github-assets/logos/igniteui.png)](http://www.igniteui.com)
308451

309452
[Ignite UI](http://igniteui.com/) is an advanced HTML5+ toolset that helps you create stunning, modern Web apps. Building on jQuery and jQuery UI, it primarily consists of feature rich, high-performing UI controls/widgets such as all kinds of charts, data visualization maps, (hierarchical, editable) data grids, pivot grids, enhanced editors (combo box, masked editors, HTML editor, date picker, to name a few), flexible data source connectors, and a whole lot more. Too many to list here - check out [the site](http://igniteui.com/) for more info and to [download](https://igniteui.com/download) a trial.

0 commit comments

Comments
 (0)