Skip to content

Commit c073248

Browse files
Remove Angular 2 Music Store workarounds for an fx bug that was fixed in RC2
1 parent 13beb7c commit c073248

File tree

9 files changed

+12
-48
lines changed

9 files changed

+12
-48
lines changed

samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-details/album-details.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ export class AlbumDetails {
1313
public albumData: models.Album;
1414

1515
constructor(http: Http, routeParam: router.RouteParams) {
16-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
17-
let isServerSide = typeof window === 'undefined';
18-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
19-
20-
http.get('/api/albums/' + routeParam.params['albumId'], options).subscribe(result => {
16+
http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => {
2117
this.albumData = result.json();
2218
});
2319
}

samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ export class AlbumEdit {
2424
private _http: Http;
2525

2626
constructor(fb: FormBuilder, http: Http, routeParam: router.RouteParams) {
27-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
28-
let isServerSide = typeof window === 'undefined';
29-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
30-
3127
this._http = http;
3228

3329
var albumId = parseInt(routeParam.params['albumId']);
34-
http.get('/api/albums/' + albumId, options).subscribe(result => {
30+
http.get('/api/albums/' + albumId).subscribe(result => {
3531
var json = result.json();
3632
this.originalAlbum = json;
3733
(<Control>this.form.controls['Title']).updateValue(json.Title);
@@ -41,11 +37,11 @@ export class AlbumEdit {
4137
(<Control>this.form.controls['AlbumArtUrl']).updateValue(json.AlbumArtUrl);
4238
});
4339

44-
http.get('/api/artists/lookup', options).subscribe(result => {
40+
http.get('/api/artists/lookup').subscribe(result => {
4541
this.artists = result.json();
4642
});
4743

48-
http.get('/api/genres/genre-lookup', options).subscribe(result => {
44+
http.get('/api/genres/genre-lookup').subscribe(result => {
4945
this.genres = result.json();
5046
});
5147

samples/angular/MusicStore/wwwroot/ng-app/components/admin/albums-list/albums-list.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ export class AlbumsList {
4545
}
4646

4747
refreshData() {
48-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
49-
let isServerSide = typeof window === 'undefined';
50-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
51-
5248
var sortBy = this._sortBy + (this._sortByDesc ? ' DESC' : '');
53-
this._http.get(`/api/albums?page=${ this._pageIndex }&pageSize=50&sortBy=${ sortBy }`, options).subscribe(result => {
49+
this._http.get(`/api/albums?page=${ this._pageIndex }&pageSize=50&sortBy=${ sortBy }`).subscribe(result => {
5450
var json = result.json();
5551
this.rows = json.Data;
5652

samples/angular/MusicStore/wwwroot/ng-app/components/app/app.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ import * as models from '../../models/models';
2424
export class App {
2525
public genres: models.Genre[];
2626

27-
constructor(http: Http) {
28-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
29-
let isServerSide = typeof window === 'undefined';
30-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
31-
32-
http.get('/api/genres/menu', options).subscribe(result => {
27+
constructor(http: Http) {
28+
http.get('/api/genres/menu').subscribe(result => {
3329
this.genres = result.json();
3430
});
3531
}

samples/angular/MusicStore/wwwroot/ng-app/components/public/album-details/album-details.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ export class AlbumDetails {
1111
public albumData: models.Album;
1212

1313
constructor(http: Http, routeParam: router.RouteParams) {
14-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
15-
let isServerSide = typeof window === 'undefined';
16-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
17-
18-
http.get('/api/albums/' + routeParam.params['albumId'], options).subscribe(result => {
14+
http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => {
1915
this.albumData = result.json();
2016
});
2117
}

samples/angular/MusicStore/wwwroot/ng-app/components/public/genre-contents/genre-contents.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ export class GenreContents {
1313
public albums: models.Album[];
1414

1515
constructor(http: Http, routeParam: router.RouteParams) {
16-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
17-
let isServerSide = typeof window === 'undefined';
18-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
19-
20-
http.get(`/api/genres/${ routeParam.params['genreId'] }/albums`, options).subscribe(result => {
16+
http.get(`/api/genres/${ routeParam.params['genreId'] }/albums`).subscribe(result => {
2117
this.albums = result.json();
2218
});
2319
}

samples/angular/MusicStore/wwwroot/ng-app/components/public/genres-list/genres-list.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ export class GenresList {
1212
public genres: models.Genre[];
1313

1414
constructor(http: Http) {
15-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
16-
let isServerSide = typeof window === 'undefined';
17-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
18-
19-
http.get('/api/genres', options).subscribe(result => {
15+
http.get('/api/genres').subscribe(result => {
2016
this.genres = result.json();
2117
});
2218
}

samples/angular/MusicStore/wwwroot/ng-app/components/public/home/home.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ export class Home {
1212
public mostPopular: models.Album[];
1313

1414
constructor(http: Http) {
15-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
16-
let isServerSide = typeof window === 'undefined';
17-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
18-
19-
http.get('/api/albums/mostPopular', options).subscribe(result => {
15+
http.get('/api/albums/mostPopular').subscribe(result => {
2016
this.mostPopular = result.json();
2117
});
2218
}

templates/Angular2Spa/ClientApp/components/fetch-data/fetch-data.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ export class FetchData {
99
public forecasts: WeatherForecast[];
1010

1111
constructor(http: Http) {
12-
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
13-
let isServerSide = typeof window === 'undefined';
14-
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
15-
16-
http.get('/api/SampleData/WeatherForecasts', options).subscribe(result => {
12+
http.get('/api/SampleData/WeatherForecasts').subscribe(result => {
1713
this.forecasts = result.json();
1814
});
1915
}

0 commit comments

Comments
 (0)