การเรียกใช้ HTTP ด้วย Provider

นำโปรเจ็กส์จาก การเรียกใช้ HTTP แบบ GET มาพัฒนาเพิ่ม

A provider is an Angular component that can be injected into other pages which allows us to call some functions.
A provider has no view, it’s only returning data to us. And that’s exactly what we need.

สร้าง provider ใหม่ชื่อ api

[code]
$ ionic g provider api
[/code]

แก้ไขไฟล์ src/providers/api/api.ts

แก้ไขไฟล์ src/pages/home/home.ts

Link