mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Remove Angular 2 Music Store workarounds for an fx bug that was fixed in RC2
This commit is contained in:
@@ -13,11 +13,7 @@ export class AlbumDetails {
|
|||||||
public albumData: models.Album;
|
public albumData: models.Album;
|
||||||
|
|
||||||
constructor(http: Http, routeParam: router.RouteParams) {
|
constructor(http: Http, routeParam: router.RouteParams) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => {
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
http.get('/api/albums/' + routeParam.params['albumId'], options).subscribe(result => {
|
|
||||||
this.albumData = result.json();
|
this.albumData = result.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,14 +24,10 @@ export class AlbumEdit {
|
|||||||
private _http: Http;
|
private _http: Http;
|
||||||
|
|
||||||
constructor(fb: FormBuilder, http: Http, routeParam: router.RouteParams) {
|
constructor(fb: FormBuilder, http: Http, routeParam: router.RouteParams) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
this._http = http;
|
this._http = http;
|
||||||
|
|
||||||
var albumId = parseInt(routeParam.params['albumId']);
|
var albumId = parseInt(routeParam.params['albumId']);
|
||||||
http.get('/api/albums/' + albumId, options).subscribe(result => {
|
http.get('/api/albums/' + albumId).subscribe(result => {
|
||||||
var json = result.json();
|
var json = result.json();
|
||||||
this.originalAlbum = json;
|
this.originalAlbum = json;
|
||||||
(<Control>this.form.controls['Title']).updateValue(json.Title);
|
(<Control>this.form.controls['Title']).updateValue(json.Title);
|
||||||
@@ -41,11 +37,11 @@ export class AlbumEdit {
|
|||||||
(<Control>this.form.controls['AlbumArtUrl']).updateValue(json.AlbumArtUrl);
|
(<Control>this.form.controls['AlbumArtUrl']).updateValue(json.AlbumArtUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
http.get('/api/artists/lookup', options).subscribe(result => {
|
http.get('/api/artists/lookup').subscribe(result => {
|
||||||
this.artists = result.json();
|
this.artists = result.json();
|
||||||
});
|
});
|
||||||
|
|
||||||
http.get('/api/genres/genre-lookup', options).subscribe(result => {
|
http.get('/api/genres/genre-lookup').subscribe(result => {
|
||||||
this.genres = result.json();
|
this.genres = result.json();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,8 @@ export class AlbumsList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshData() {
|
refreshData() {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
var sortBy = this._sortBy + (this._sortByDesc ? ' DESC' : '');
|
var sortBy = this._sortBy + (this._sortByDesc ? ' DESC' : '');
|
||||||
this._http.get(`/api/albums?page=${ this._pageIndex }&pageSize=50&sortBy=${ sortBy }`, options).subscribe(result => {
|
this._http.get(`/api/albums?page=${ this._pageIndex }&pageSize=50&sortBy=${ sortBy }`).subscribe(result => {
|
||||||
var json = result.json();
|
var json = result.json();
|
||||||
this.rows = json.Data;
|
this.rows = json.Data;
|
||||||
|
|
||||||
|
|||||||
@@ -25,11 +25,7 @@ export class App {
|
|||||||
public genres: models.Genre[];
|
public genres: models.Genre[];
|
||||||
|
|
||||||
constructor(http: Http) {
|
constructor(http: Http) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
http.get('/api/genres/menu').subscribe(result => {
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
http.get('/api/genres/menu', options).subscribe(result => {
|
|
||||||
this.genres = result.json();
|
this.genres = result.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ export class AlbumDetails {
|
|||||||
public albumData: models.Album;
|
public albumData: models.Album;
|
||||||
|
|
||||||
constructor(http: Http, routeParam: router.RouteParams) {
|
constructor(http: Http, routeParam: router.RouteParams) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => {
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
http.get('/api/albums/' + routeParam.params['albumId'], options).subscribe(result => {
|
|
||||||
this.albumData = result.json();
|
this.albumData = result.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,7 @@ export class GenreContents {
|
|||||||
public albums: models.Album[];
|
public albums: models.Album[];
|
||||||
|
|
||||||
constructor(http: Http, routeParam: router.RouteParams) {
|
constructor(http: Http, routeParam: router.RouteParams) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
http.get(`/api/genres/${ routeParam.params['genreId'] }/albums`).subscribe(result => {
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
http.get(`/api/genres/${ routeParam.params['genreId'] }/albums`, options).subscribe(result => {
|
|
||||||
this.albums = result.json();
|
this.albums = result.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ export class GenresList {
|
|||||||
public genres: models.Genre[];
|
public genres: models.Genre[];
|
||||||
|
|
||||||
constructor(http: Http) {
|
constructor(http: Http) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
http.get('/api/genres').subscribe(result => {
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
http.get('/api/genres', options).subscribe(result => {
|
|
||||||
this.genres = result.json();
|
this.genres = result.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ export class Home {
|
|||||||
public mostPopular: models.Album[];
|
public mostPopular: models.Album[];
|
||||||
|
|
||||||
constructor(http: Http) {
|
constructor(http: Http) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
http.get('/api/albums/mostPopular').subscribe(result => {
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
http.get('/api/albums/mostPopular', options).subscribe(result => {
|
|
||||||
this.mostPopular = result.json();
|
this.mostPopular = result.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ export class FetchData {
|
|||||||
public forecasts: WeatherForecast[];
|
public forecasts: WeatherForecast[];
|
||||||
|
|
||||||
constructor(http: Http) {
|
constructor(http: Http) {
|
||||||
// Workaround for RC1 bug. This can be removed with ASP.NET Core 1.0 RC2.
|
http.get('/api/SampleData/WeatherForecasts').subscribe(result => {
|
||||||
let isServerSide = typeof window === 'undefined';
|
|
||||||
let options: any = isServerSide ? { headers: { Connection: 'keep-alive' } } : null;
|
|
||||||
|
|
||||||
http.get('/api/SampleData/WeatherForecasts', options).subscribe(result => {
|
|
||||||
this.forecasts = result.json();
|
this.forecasts = result.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user