-
- Notifications
You must be signed in to change notification settings - Fork 240
Closed
Description
Right now, doing this (assuming similar semantics that Image
component uses for local src
binding):
this.http.get(`~/assets/data.json`) .map((response: Response) => response.json()) .subscribe((results: string[]) => { // never gets here });
Does not work.
Then only way I know to load a local file would be to use something like following:
let app = knownFolders.currentApp(); let localFile = app.getFile(`assets/data.json`); localFile.readText().then((data) => { try { resolve(JSON.parse(data)); } catch (err) { reject(err); } }, (err) => { reject(err); });
That of course is not very intuitive to Angular devs.
Is there another way to do this using just Angular's Http
?
rerezz
Metadata
Metadata
Assignees
Labels
No labels