From the course: Ionic 4.0 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Using a data model interface - Ionic Tutorial
From the course: Ionic 4.0 Essential Training
Using a data model interface
You might be wondering what should we do with the interface? Well, here's what we're going to do. We are going to make sure that our two methods, get activity and get all activities are returning the correct type of data. Remember what I said earlier? an observable is returned. Now we're going to type cast this observable and say, it is of type observable, and hit enter. And this observable type is of type activity, and hit enter. Now at this point in time, it is worth noting that I am leveraging on Visual Studios ability to automatically import specific things for me. For example, if you look at line three and line four, just by merely typing the observable, Visual Studio Code was able to import The same thing happened on line four, was able to detect and import the activity interface for me. you will need to manually write these lines of code. The next thing we're going to go and do our get activity function says that it will be returning an observable of type activity, the HTTP…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Overview of Ionic UI components5m 35s
-
(Locked)
Designing the home page with cards8m 16s
-
(Locked)
Generating services4m 40s
-
(Locked)
Consuming REST APIs4m 16s
-
(Locked)
Consuming REST APIs: Implementing methods3m 3s
-
(Locked)
Creating a data model and interface4m 6s
-
(Locked)
Using a data model interface3m 54s
-
(Locked)
Finalizing the home page design10m 2s
-
-
-
-
-
-