Search⌘ K
AI Features

Custom Students Service

Discover how to create a custom Students service in Angular to supply student data for your Ionic attendance app. Learn to define TypeScript interfaces, create mock data arrays, and implement a basic getAll() function to support data binding on your roster page.

Before you flesh out the Roster page, you need to get some students to display. Later you will want to tie the list into a data store of some sort, but you do not need to do that just to get some data displayed on the page.

Angular services

For that, you are going to create a simple “Students” service you can inject into the pages that need it. Use the command line to create the service.

Angular CLI

In this case, it does not matter whether or not you use the Angular CLI or the Ionic CLI. Go ahead and use ...