mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Update to Angular 4 (but leave directory name as Angular2Spa until finished)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
|
||||
@Component({
|
||||
@@ -8,8 +8,8 @@ import { Http } from '@angular/http';
|
||||
export class FetchDataComponent {
|
||||
public forecasts: WeatherForecast[];
|
||||
|
||||
constructor(http: Http) {
|
||||
http.get('/api/SampleData/WeatherForecasts').subscribe(result => {
|
||||
constructor(http: Http, @Inject('ORIGIN_URL') originUrl: string) {
|
||||
http.get(originUrl + '/api/SampleData/WeatherForecasts').subscribe(result => {
|
||||
this.forecasts = result.json() as WeatherForecast[];
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user