File tree Expand file tree Collapse file tree 9 files changed +12
-48
lines changed
samples/angular/MusicStore/wwwroot/ng-app/components
templates/Angular2Spa/ClientApp/components/fetch-data Expand file tree Collapse file tree 9 files changed +12
-48
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -24,12 +24,8 @@ import * as models from '../../models/models';
2424export 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments