Skip to content

api to assets #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
api's should be called from assets folder for now
  • Loading branch information
johnpapa committed Aug 8, 2022
commit 97d35dbbb46a1305ea227eace014bc78517a407d
6 changes: 2 additions & 4 deletions _examples/compare/angular/http/app/vehicle.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ export class VehicleService {

getVehicles() {
return this.http
.get('api/vehicles.json')
.map((response: Response) =>
<Vehicle[]>response.json().data
)
.get("assets/vehicles.json")
.map((response: Response) => <Vehicle[]>response.json().data)
.catch(this.handleError);
}

Expand Down
2 changes: 1 addition & 1 deletion _examples/component-input-output/app/character.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class CharacterService {

getCharacters(storyId: number) {
return this.http
.get('api/characters.json')
.get("assets/characters.json")
.map((response: Response) => response.json().data);
}
}
8 changes: 5 additions & 3 deletions _examples/http-async/app/vehicle.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ export class VehicleService {

getVehicles(value?: string) {
return this.http
.get('api/vehicles.json')
.get("assets/vehicles.json")
.map((response: Response) => {
let vehicles = <Vehicle[]>response.json().data;
if (!value) {
return vehicles;
}
return vehicles.filter(v => v.name.toLowerCase().includes(value.toLowerCase()));
return vehicles.filter((v) =>
v.name.toLowerCase().includes(value.toLowerCase())
);
})
.do(data => console.log(data))
.do((data) => console.log(data))
.catch(this.handleError);
}

Expand Down
3 changes: 2 additions & 1 deletion _examples/http-promise/app/vehicle.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export class VehicleService {
constructor(private http: Http) { }

getVehicles(value?: string) {
return this.http.get('api/vehicles.json')
return this.http
.get("assets/vehicles.json")
.map((response: Response) => <Vehicle[]>response.json().data)
.toPromise()
.catch(this.handleError);
Expand Down
2 changes: 1 addition & 1 deletion _examples/http/app/vehicle.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class VehicleService {

getVehicles() {
return this.http
.get('api/vehicles.json')
.get('assets/vehicles.json')
.map((response: Response) => <Vehicle[]>response.json().data)
.do(data => console.log(data))
.catch(this.handleError);
Expand Down