Skip to content

Commit 6d65c60

Browse files
committed
build primeng
1 parent 84af568 commit 6d65c60

File tree

8 files changed

+121
-109
lines changed

8 files changed

+121
-109
lines changed

server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ app.get('*', (req, res) => {
4343
global['document'] = template;
4444
global['navigator'] = req['headers']['user-agent'];
4545
global['CSS'] = null;
46-
global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
46+
// global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
4747
res.render('../dist/index', {
4848
req: req,
4949
res: res,

src/app/primengPage/components/autocomplete/autocompletedemo.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@ export class AutoCompleteDemo {
2323

2424
constructor(private countryService: CountryService) { }
2525

26-
filterCountrySingle(event) {
26+
async filterCountrySingle(event) {
2727
const query = event.query;
28-
this.countryService.getCountries().then(countries => {
29-
this.filteredCountriesSingle = this.filterCountry(query, countries);
30-
});
28+
const countries = await this.countryService.getCountriesAsync();
29+
this.filteredCountriesSingle = this.filterCountry(query, countries);
3130
}
3231

33-
filterCountryMultiple(event) {
32+
async filterCountryMultiple(event) {
3433
const query = event.query;
35-
this.countryService.getCountries().then(countries => {
36-
this.filteredCountriesMultiple = this.filterCountry(query, countries);
37-
});
34+
const countries = await this.countryService.getCountriesAsync();
35+
this.filteredCountriesMultiple = this.filterCountry(query, countries);
3836
}
3937

4038
filterCountry(query, countries: any[]): any[] {

src/app/primengPage/components/dragdrop/dragdropdemo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export class DragDropDemo implements OnInit {
2626

2727
async ngOnInit() {
2828
this.selectedCars = [];
29-
this.availableCars = await this.carService.getCarsSmallAsync().then(cars => cars);
29+
this.availableCars = await this.carService.getCarsSmallAsync();
30+
console.log(this.availableCars);
3031
}
3132

3233
dragStart(event, car: Car) {

src/app/primengPage/primengPage.routing.ts

Lines changed: 91 additions & 87 deletions
Large diffs are not rendered by default.

src/app/primengPage/service/carservice.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ export class CarService {
1212
constructor(private http: TransferHttp) { }
1313

1414
async getCarsSmallAsync() {
15-
return await this.http.get('http://localhost:4000/assets/showcase/data/cars-small.json')
15+
const result = await this.http.get('http://localhost:4000/assets/showcase/data/cars-small.json')
1616
.toPromise();
17+
return result.data;
1718
}
1819

1920
async getCarsMediumAsync() {
20-
return await this.http.get('http://localhost:4000/assets/showcase/data/cars-medium.json')
21+
const result = await this.http.get('http://localhost:4000/assets/showcase/data/cars-medium.json')
2122
.toPromise();
23+
return result.data;
2224
}
2325

2426
async getCarsLargeAsync() {
25-
return await this.http.get('http://localhost:4000/assets/showcase/data/cars-large.json')
27+
const result = await this.http.get('http://localhost:4000/assets/showcase/data/cars-large.json')
2628
.toPromise();
29+
return result.data;
2730
}
2831
}

src/app/primengPage/service/countryservice.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import { Injectable } from '@angular/core';
77
@Injectable()
88
export class CountryService {
99

10-
constructor(private http: TransferHttp) { }
10+
constructor(private http: TransferHttp) { }
1111

12-
async getCountriesAsync() {
13-
return await this.http.get('assets/showcase/data/countries.json')
12+
async getCountriesAsync() {
13+
const result = await this.http.get('assets/showcase/data/countries.json')
1414
.toPromise();
15-
}
15+
return result.data;
16+
}
1617
}

src/app/primengPage/service/eventservice.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export class EventService {
1010
constructor(private http: TransferHttp) { }
1111

1212
async getEvents() {
13-
return await this.http.get('assets/showcase/data/scheduleevents.json')
13+
const result = await this.http.get('assets/showcase/data/scheduleevents.json')
1414
.toPromise();
15+
return result.data;
1516
}
1617
}

src/app/primengPage/service/nodeservice.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@ export class NodeService {
1212
constructor(private http: TransferHttp) { }
1313

1414
async getFilesAsync() {
15-
return await this.http.get('assets/showcase/data/files.json')
15+
const result = await this.http.get('assets/showcase/data/files.json')
1616
.toPromise();
17+
return result.data;
1718
}
1819

1920
async getLazyFilesAsync() {
20-
return await this.http.get('assets/showcase/data/files-lazy.json')
21+
const result = await this.http.get('assets/showcase/data/files-lazy.json')
2122
.toPromise();
23+
return result.data;
2224
}
2325

2426
async getFilesystemAsync() {
25-
return await this.http.get('assets/showcase/data/filesystem.json')
27+
const result = await this.http.get('assets/showcase/data/filesystem.json')
2628
.toPromise();
29+
return result.data;
2730
}
2831

2932
async getLazyFilesystemAsync() {
30-
return await this.http.get('assets/showcase/data/filesystem-lazy.json')
33+
const result = await this.http.get('assets/showcase/data/filesystem-lazy.json')
3134
.toPromise();
35+
return result.data;
3236
}
3337
}

0 commit comments

Comments
 (0)