Skip to content

Commit fab2dd0

Browse files
authored
Merge pull request #102 from dkamburov/master
Add sample with igGrid and WebAPI
2 parents 93fcd40 + 4a4e7c1 commit fab2dd0

File tree

9 files changed

+459
-74
lines changed

9 files changed

+459
-74
lines changed

app/samples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Inject, ElementRef, EventEmitter, HostListener} from '@angular/core';
1+
import { Component } from '@angular/core';
22

33
declare var jQuery: any;
44
@Component({

index.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
<div class="row">
113113
<div class="col-sm-12 col-lg-5">
114114
<h1>Ignite UI</h1>
115-
<h2>Angular 2 Directives</h2>
115+
<h2>Angular 2 Components</h2>
116116
</div>
117117
<div class="col-sm-12 header-fg col-lg-7"></div>
118118
</div>
@@ -130,21 +130,19 @@ <h2>Live sample...</h2>
130130
<h2>Code...</h2>
131131
<div style="height: 511px; overflow-y: scroll;">
132132
<pre>
133-
import {Component, Inject, ElementRef, EventEmitter, HostListener} from '@angular/core';
134-
import {IgGridComponent} from "../src/igniteui.angular2.ts";
133+
import { Component } from '@angular/core';
135134

136135
declare var jQuery: any;
137136
@Component({
138-
selector: 'my-app',
137+
selector: "my-app",
139138
template: `
140139
&lt;ig-grid
141140
[(options)]=&quot;gridOptions&quot;
142-
[(widgetId)]='id'
141+
[(widgetId)]="id"
143142
(cellClick)=&quot;cellClickHandler($event)&quot;
144-
(rendering)='renderedEventHandler($event)'
143+
(rendering)="renderedEventHandler($event)"
145144
&gt;&lt;/ig-grid&gt;
146-
`,
147-
directives: [IgGridComponent]
145+
`
148146
})
149147
export class AppComponent {
150148
private gridOptions: IgGrid;
@@ -209,6 +207,7 @@ <h2>Samples</h2>
209207
<li><a href="samples/igGrid/igGrid.html">Default</a></li>
210208
<li><a href="samples/igGrid-TopLevelOpts/igGrid-TopLevelOpts.html">Top-level template options</a></li>
211209
<li><a href="samples/igGrid-ComplexOpts/igGrid-ComplexOpts.html">Complex template options</a></li>
210+
<li><a href="samples/igGrid-HTTPClient/igGrid-HTTPClient.html">Grid with HTTP client</a></li>
212211
</ul>
213212
</div>
214213
<a class="btn btn-default" href="samples/igHierarchicalGrid/igHierarchicalGrid.html">igHierarchicalGrid</a>

package.json

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,65 @@
1-
{
2-
"name": "igniteui-angular2",
3-
"version": "1.0.0",
4-
"license": "MIT",
5-
"repository": {
6-
"type": "git",
7-
"url": "https://github.com/IgniteUI/igniteui-angular2.git"
8-
},
9-
"dependencies": {
10-
"@angular/common": "2.0.0",
11-
"@angular/compiler": "2.0.0",
12-
"@angular/core": "2.0.0",
13-
"@angular/http": "2.0.0",
14-
"@angular/forms": "2.0.0",
15-
"@angular/platform-browser": "2.0.0",
16-
"@angular/platform-browser-dynamic": "2.0.0",
17-
"@angular/router": "3.0.0",
18-
"@angular/upgrade": "2.0.0",
19-
20-
"systemjs": "0.19.27",
21-
"es6-shim": "^0.35.0",
22-
"reflect-metadata": "^0.1.3",
23-
"rxjs": "5.0.0-beta.12",
24-
"zone.js": "^0.6.23",
25-
26-
"bootstrap": "^3.3.6"
27-
},
28-
"devDependencies": {
29-
"concurrently": "^2.2.0",
30-
"gulp-watch": "^4.3.5",
31-
"jasmine-core": "^2.4.1",
32-
"karma": "^0.13.19",
33-
"karma-chrome-launcher": "^0.2.2",
34-
"karma-jasmine": "^0.2.2",
35-
"karma-junit-reporter": "^0.4.2",
36-
"karma-coverage": "",
37-
"karma-remap-istanbul": "",
38-
"lite-server": "^2.2.0",
39-
"typescript": "^2.0.2",
40-
"typings": "^0.8.1",
41-
"coveralls": "^2.11.9",
42-
"traceur": "^0.0.111"
43-
},
44-
"scripts": {
45-
"postinstall": "npm run typings && npm prune",
46-
"typings": "node node_modules/typings/dist/bin.js install",
47-
48-
"start": "npm run lite",
49-
"lite": "lite-server",
50-
51-
"watch": "node node_modules/typescript/bin/tsc -w",
52-
"build": "node node_modules/typescript/bin/tsc",
53-
"bundle": "node node_modules/typescript/bin/tsc -d && npm run prepare-dist",
54-
"prepare-dist": "cp src/igniteui.angular2.js dist/npm/ && cp src/igniteui.angular2.d.ts dist/npm/ && cp src/igniteui.d.ts dist/npm/ && cp src/jquery.d.ts dist/npm/",
55-
56-
"pretest": "npm run build",
57-
"test": "karma start tests/karma.conf.js && npm run remap-istanbul",
58-
59-
"remap-istanbul": "npm run copy-coverage-report && npm run remap-istanbul-html && npm run remap-istanbul-lcov",
60-
"remap-istanbul-html": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/html-report -t html",
61-
"remap-istanbul-lcov": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/lcov.info -t lcovonly",
62-
"copy-coverage-report": "cp coverage/karma-tmp/**/coverage*.json coverage/karma-tmp/"
63-
}
64-
}
1+
{
2+
"name": "igniteui-angular2",
3+
"version": "1.0.0",
4+
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/IgniteUI/igniteui-angular2.git"
8+
},
9+
"dependencies": {
10+
"@angular/common": "~2.0.2",
11+
"@angular/compiler": "~2.0.2",
12+
"@angular/core": "~2.0.2",
13+
"@angular/http": "~2.0.2",
14+
"@angular/forms": "~2.0.2",
15+
"@angular/platform-browser": "~2.0.2",
16+
"@angular/platform-browser-dynamic": "~2.0.2",
17+
"@angular/router": "~3.0.2",
18+
"@angular/upgrade": "~2.0.2",
19+
"angular-in-memory-web-api": "~0.1.5",
20+
21+
"systemjs": "0.19.27",
22+
"es6-shim": "^0.35.0",
23+
"reflect-metadata": "^0.1.3",
24+
"rxjs": "5.0.0-beta.12",
25+
"zone.js": "^0.6.23",
26+
27+
"bootstrap": "^3.3.6"
28+
},
29+
"devDependencies": {
30+
"concurrently": "^2.2.0",
31+
"gulp-watch": "^4.3.5",
32+
"jasmine-core": "^2.4.1",
33+
"karma": "^0.13.19",
34+
"karma-chrome-launcher": "^0.2.2",
35+
"karma-jasmine": "^0.2.2",
36+
"karma-junit-reporter": "^0.4.2",
37+
"karma-coverage": "",
38+
"karma-remap-istanbul": "",
39+
"lite-server": "^2.2.0",
40+
"typescript": "^2.0.2",
41+
"typings": "^0.8.1",
42+
"coveralls": "^2.11.9",
43+
"traceur": "^0.0.111"
44+
},
45+
"scripts": {
46+
"postinstall": "npm run typings && npm prune",
47+
"typings": "node node_modules/typings/dist/bin.js install",
48+
49+
"start": "npm run lite",
50+
"lite": "lite-server",
51+
52+
"watch": "node node_modules/typescript/bin/tsc -w",
53+
"build": "node node_modules/typescript/bin/tsc",
54+
"bundle": "node node_modules/typescript/bin/tsc -d && npm run prepare-dist",
55+
"prepare-dist": "cp src/igniteui.angular2.js dist/npm/ && cp src/igniteui.angular2.d.ts dist/npm/ && cp src/igniteui.d.ts dist/npm/ && cp src/jquery.d.ts dist/npm/",
56+
57+
"pretest": "npm run build",
58+
"test": "karma start tests/karma.conf.js && npm run remap-istanbul",
59+
60+
"remap-istanbul": "npm run copy-coverage-report && npm run remap-istanbul-html && npm run remap-istanbul-lcov",
61+
"remap-istanbul-html": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/html-report -t html",
62+
"remap-istanbul-lcov": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/lcov.info -t lcovonly",
63+
"copy-coverage-report": "cp coverage/karma-tmp/**/coverage*.json coverage/karma-tmp/"
64+
}
65+
}

samples/data/product-data.ts

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
import { InMemoryDbService } from 'angular-in-memory-web-api';
2+
export class ProductData implements InMemoryDbService {
3+
createDb() {
4+
let products = [
5+
{
6+
"ProductID": 1,
7+
"ProductName": "Chai",
8+
"DealerName": "A",
9+
"CategoryName": "Beverages",
10+
"ImageUrl": "../../images/samples/nw/categories/1.png",
11+
"InStock": 39,
12+
"Inventory": ""
13+
},
14+
{
15+
"ProductID": 2,
16+
"ProductName": "Chang",
17+
"DealerName": "B",
18+
"CategoryName": "Beverages",
19+
"ImageUrl": "../../images/samples/nw/categories/1.png",
20+
"InStock": 17,
21+
"Inventory": ""
22+
},
23+
{
24+
25+
"ProductID": 3,
26+
"ProductName": "Aniseed Syrup",
27+
"DealerName": "C",
28+
"CategoryName": "Condiments",
29+
"ImageUrl": "../../images/samples/nw/categories/2.png",
30+
"InStock": 13,
31+
"Inventory": ""
32+
},
33+
{
34+
"ProductID": 4,
35+
"ProductName": "Chef Anton\u0027s Cajun Seasoning",
36+
"DealerName": "D",
37+
"CategoryName": "Condiments",
38+
"ImageUrl": "../../images/samples/nw/categories/2.png",
39+
"InStock": 53,
40+
"Inventory": ""
41+
},
42+
{
43+
44+
"ProductID": 5,
45+
"ProductName": "Chef Anton\u0027s Gumbo Mix",
46+
"DealerName": "E",
47+
"CategoryName": "Condiments",
48+
"ImageUrl": "../../images/samples/nw/categories/2.png",
49+
"InStock": 0,
50+
"Inventory": ""
51+
},
52+
{
53+
54+
"ProductID": 6,
55+
"ProductName": "Grandma\u0027s Boysenberry Spread",
56+
"DealerName": "F",
57+
"CategoryName": "Condiments",
58+
"ImageUrl": "../../images/samples/nw/categories/2.png",
59+
"InStock": 120,
60+
"Inventory": ""
61+
},
62+
{
63+
64+
"ProductID": 7,
65+
"ProductName": "Uncle Bob\u0027s Organic Dried Pears",
66+
"DealerName": "G",
67+
"CategoryName": "Produce",
68+
"ImageUrl": "../../images/samples/nw/categories/7.png",
69+
"InStock": 15,
70+
"Inventory": ""
71+
},
72+
{
73+
74+
"ProductID": 8,
75+
"ProductName": "Northwoods Cranberry Sauce",
76+
"DealerName": "H",
77+
"CategoryName": "Condiments",
78+
"ImageUrl": "../../images/samples/nw/categories/2.png",
79+
"InStock": 6,
80+
"Inventory": ""
81+
},
82+
{
83+
84+
"ProductID": 9,
85+
"ProductName": "Mishi Kobe Niku",
86+
"DealerName": "I",
87+
"CategoryName": "Meat/Poultry",
88+
"ImageUrl": "../../images/samples/nw/categories/6.png",
89+
"InStock": 29,
90+
"Inventory": ""
91+
},
92+
{
93+
94+
"ProductID": 10,
95+
"ProductName": "Ikura",
96+
"DealerName": "J",
97+
"CategoryName": "Seafood",
98+
"ImageUrl": "../../images/samples/nw/categories/8.png",
99+
"InStock": 31,
100+
"Inventory": ""
101+
},
102+
{
103+
104+
"ProductID": 11,
105+
"ProductName": "Queso Cabrales",
106+
"DealerName": "K",
107+
"CategoryName": "Dairy Products",
108+
"ImageUrl": "../../images/samples/nw/categories/4.png",
109+
"InStock": 22,
110+
"Inventory": ""
111+
},
112+
{
113+
114+
"ProductID": 12,
115+
"ProductName": "Queso Manchego La Pastora",
116+
"DealerName": "J",
117+
"CategoryName": "Dairy Products",
118+
"ImageUrl": "../../images/samples/nw/categories/4.png",
119+
"InStock": 86,
120+
"Inventory": ""
121+
},
122+
{
123+
124+
"ProductID": 13,
125+
"ProductName": "Konbu",
126+
"DealerName": "K",
127+
"CategoryName": "Seafood",
128+
"ImageUrl": "../../images/samples/nw/categories/8.png",
129+
"InStock": 24,
130+
"Inventory": ""
131+
},
132+
{
133+
134+
"ProductID": 14,
135+
"ProductName": "Tofu",
136+
"DealerName": "L",
137+
"CategoryName": "Produce",
138+
"ImageUrl": "../../images/samples/nw/categories/7.png",
139+
"InStock": 35,
140+
"Inventory": ""
141+
},
142+
{
143+
144+
"ProductID": 15,
145+
"ProductName": "Genen Shouyu",
146+
"DealerName": "M",
147+
"CategoryName": "Condiments",
148+
"ImageUrl": "../../images/samples/nw/categories/2.png",
149+
"InStock": 39,
150+
"Inventory": ""
151+
}
152+
];
153+
return {products};
154+
}
155+
}

0 commit comments

Comments
 (0)