{"id":2720,"date":"2019-04-11T16:47:33","date_gmt":"2019-04-11T16:47:33","guid":{"rendered":"https:\/\/ionicframework.com\/?p=2720"},"modified":"2020-10-15T22:31:35","modified_gmt":"2020-10-15T22:31:35","slug":"full-stack-typescript-with-ionic-angular-and-nestjs-part-1","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1","title":{"rendered":"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Welcome to the first post in a new series we\u2019re kicking off all about building a full stack TypeScript app using Ionic, Angular and NestJS.<\/p>\n<p>TypeScript is a powerful language that is a superset of JavaScript, with some additional features added to help build out large scale applications. One of my favorite features of TypeScript is its optional static type checking. I was a longtime static language dev (C#) before coming to the front-end, and even though I enjoyed the dynamic nature of JavaScript, I would often run into runtime errors and bugs in my client-side code because there was no type checking to help ensure the system I wrote was correct. TypeScript helps fix this by providing a way to add types to your variables and objects that are evaluated at dev time, but removed and turned into plain JavaScript when running in the browser.<\/p>\n<p><!--more--><\/p>\n<p>Beyond type checking, TypeScript also helps you speed up your development by providing code completion and refactoring, as well as letting you use modern JavaScript language features that might not be available in all browsers yet.<\/p>\n<p>Ionic and Angular developers have adopted TypeScript as their primary language for their client-side development for a few years now. However, TypeScript can run anywhere JavaScript can, which includes the server!<\/p>\n<p>Front-end devs often turn to Node for their backend needs. The reasons are numerous, as Node provides a great runtime that works with the language with which they are most familiar (JavaScript). A couple of years ago, I was starting a new Node project and wanted to use TypeScript in it because I was curious if I could use TypeScript&#8217;s decorators to help define routes and place them directly on the controllers. Additionally, I liked this pattern from ASP.Net MVC and figured it would be possible with TypeScript.<\/p>\n<p>It didn&#8217;t take much searching until I found a little, somewhat unknown, project called NestJS. Nest billed itself as a Node framework built with the power of TypeScript. I was immediately intrigued!<\/p>\n<h2>Meet NestJS<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"354\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthomepage.jpg\" alt=\"\" class=\"aligncenter size-full wp-image-2721 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthomepage.jpg 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthomepage-300x177.jpg 300w\" data-sizes=\"auto, (max-width: 600px) 100vw, 600px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/354;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"354\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthomepage.jpg\" alt=\"\" class=\"aligncenter size-full wp-image-2721\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthomepage.jpg 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthomepage-300x177.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/noscript><\/p>\n<p><a href=\"https:\/\/nestjs.com\/\" target=\"_blank\" rel=\"noopener\">NestJS<\/a> (just Nest from here on out), is a Node framework meant to build server-side applications. Not only is it a framework, but it is also a platform to meet many backend application needs, like writing APIs, building microservices, or doing real-time communications through web sockets. For us Ionic devs, it is a great solution to write our backends with because it fits in so well with the rest of our ecosystem.<\/p>\n<p>Nest is also heavily influenced by Angular, and, as an Angular dev, you will immediately find its concepts familiar. The creators of Nest strived to make the learning curve as small as possible, while still taking advantage of many higher level concepts such as modules, controllers, and dependency injection.<\/p>\n<p>However, this doesn\u2019t mean that Nest is only for Angular devs. On its own, Nest is a powerful framework that anyone looking to build server-side applications on Node should consider. Moreover, Nest is also similar to other MVC (model, view, controller) frameworks out there, like ASP.Net MVC and Spring. Developers coming from other enterprise frameworks will find Nest familiar.<\/p>\n<p>Since you use TypeScript (or JavaScript) to write a Nest application, one of the most intriguing features of Nest is the ability to use the same language on the client that you use on the server. This helps speed up development as your developers don&#8217;t need to context switch between the idiosyncrasies different languages can have. The unified language also opens doors for some potential code reuse between your front-end and back-end.<\/p>\n<p>Are you interested in taking Nest for a spin and building out a backend for you Ionic apps? Great, let&#8217;s get started!<\/p>\n<h2>Our App<\/h2>\n<p>A typical full-stack tutorial has you build out a todo app. Todo apps are way too lame to waste on great tech such as Ionic, Angular, and Nest. So, in this tutorial series, we are going to build an app for space rangers \ud83d\ude80. Our app will provide a list of missions a space ranger can go on, and have them enter their own missions. Once finished, they can mark their mission as complete.<\/p>\n<p>You might be thinking this sounds like another todo app, but it&#8217;s not. It&#8217;s way cooler. It has space kitties. We will call it GoSpaceRanger.<\/p>\n<h2>Getting Started<\/h2>\n<p>I&#8217;m going to assume you are all set to get started with Ionic and Angular, but if not, head over to our <a href=\"https:\/\/ionicframework.com\/docs\/installation\/cli\" target=\"_blank\" rel=\"noopener\">getting started guide<\/a> to get those setup.<\/p>\n<p>First, create a new directory called <code>go-space-ranger<\/code> wherever you like to do your developer things and <code>cd<\/code> into it. We will create two applications (an Ionic and a Nest app) via CLIs in this directory.<\/p>\n<p>Nest also comes with a CLI that is relatively similar to that of Ionic and Angular. Install it via NPM:<\/p>\n<pre><code class=\"language-bash\">npm i -g @nestjs\/cli\n<\/code><\/pre>\n<p>Use the Nest CLI to kick off a new app:<\/p>\n<pre><code class=\"language-bash\">nest new gsr-server\n<\/code><\/pre>\n<p>When asked, select NPM as your package manager.<\/p>\n<p>Go into the <code>gar-server<\/code> directory Nest created, and start up the development server by running:<\/p>\n<pre><code class=\"language-bash\">npm run start:dev\n<\/code><\/pre>\n<p>This command kicks off a development server and loads your Nest app on a default port of 3000. Open up your browser to http:\/\/localhost:3000, and you should see:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"306\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthelloworld.png\" alt=\"\" class=\"aligncenter size-full wp-image-2722 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthelloworld.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthelloworld-300x153.png 300w\" data-sizes=\"auto, (max-width: 600px) 100vw, 600px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/306;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"306\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthelloworld.png\" alt=\"\" class=\"aligncenter size-full wp-image-2722\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthelloworld.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nesthelloworld-300x153.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/noscript><\/p>\n<p>Open up the <code>gsr-server<\/code> directory in your editor of choice. I&#8217;ll be showing VS Code in this tutorial and will talk about some tips on how to use it, but feel free to use what you are comfortable with. Let&#8217;s take a brief tour of the default Nest project.<\/p>\n<h2>The Nest Project Structure<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"425\" height=\"448\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/defaultneststructure.png\" alt=\"\" class=\"aligncenter size-full wp-image-2723 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/defaultneststructure.png 425w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/defaultneststructure-285x300.png 285w\" data-sizes=\"auto, (max-width: 425px) 100vw, 425px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 425px; --smush-placeholder-aspect-ratio: 425\/448;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"425\" height=\"448\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/defaultneststructure.png\" alt=\"\" class=\"aligncenter size-full wp-image-2723\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/defaultneststructure.png 425w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/defaultneststructure-285x300.png 285w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/noscript><\/p>\n<p>There is nothing too crazy going on here. By default, Nest gives you a few goodies out of the box, that you would typically have to set up on your own. For code formatting and code style, Nest includes a Prettier and TSLint setup. Nodemon is included to recompile your app on each code change. Typescript is all set up as well. The config files for all these tools have sensible defaults, but feel free to modify them to fit your style.<\/p>\n<p>The <code>src<\/code> folder contains all your app code.<\/p>\n<p>The <code>main.ts<\/code> is the file that bootstraps your application. By default, Nest uses Express as the web framework to serve the HTTP requests. If you needed to do any additional configuration or add any Express middleware, you would do it here.<\/p>\n<p>The <code>app.module.ts<\/code> file is familiar to Angular devs. The module serves the same concept here in Nest that it does in Angular. Modules provide logical separation in your app and give the configuration needed for each section.<\/p>\n<p>When it comes down to it, Nest implements an MVC (model, view, controller) design pattern. In MVC, controllers listen in for incoming requests, call into services for data access and business logic, then serve out the models from the services back to the client.<\/p>\n<p>The <code>app.controller.ts<\/code> file is a simple implementation of a controller:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"287\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestcontroller.png\" alt=\"\" class=\"aligncenter size-full wp-image-2724 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestcontroller.png 598w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestcontroller-300x144.png 300w\" data-sizes=\"auto, (max-width: 598px) 100vw, 598px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 598px; --smush-placeholder-aspect-ratio: 598\/287;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"287\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestcontroller.png\" alt=\"\" class=\"aligncenter size-full wp-image-2724\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestcontroller.png 598w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestcontroller-300x144.png 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/noscript><\/p>\n<p>Controllers are just pure ES6 classes that have a <code>@Controller<\/code> decorator on them. The decorator takes a string param that specifies the route the controller should listen for requests at. Since it is omitted here, this <code>AppController<\/code> listens to the root path &#8216;\/&#8217;.<\/p>\n<p>Nest also uses decorators on methods in a controller to designate which HTTP verbs (Get, Post, Put, Delete, etc&#8230;) a method should respond to. In our <code>AppController<\/code>, when a GET request comes in, Nest responds by invoking the <code>getHello<\/code> method.<\/p>\n<p>Our controller has a service named <code>appService<\/code> injected into it. A Nest service is another ES6 class that is registered with Nest&#8217;s dependency injection framework as a provider.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"198\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestservice.png\" alt=\"\" class=\"aligncenter size-full wp-image-2725 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestservice.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestservice-300x99.png 300w\" data-sizes=\"auto, (max-width: 600px) 100vw, 600px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/198;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"198\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestservice.png\" alt=\"\" class=\"aligncenter size-full wp-image-2725\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestservice.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestservice-300x99.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/noscript><\/p>\n<p>This simple class has a single method that returns a string. If your server is still running (via NPM), go ahead and modify the string, then go back to your browser and refresh. Since the server is running in dev mode, Nodemon automatically recompiles and restarts the app every time a file changes.<\/p>\n<p>Now that we know the basic structure of a Nest app, let&#8217;s create some of our own services and controllers.<\/p>\n<h2>Your First Nest Service and Controller<\/h2>\n<p>Our GoSpaceRanger app returns back a list of &#8220;missions&#8221; that our space rangers can respond to. So, to kick off our new app, let&#8217;s create a model to represent a mission. Create a new folder in <code>src<\/code> named <code>models<\/code>, then create a new <code>mission.model.ts<\/code> and paste in the following code:<\/p>\n<pre><code class=\"language-typescript\">export class Mission {\n  id?: number;\n  title: string;\n  reward: number;\n  active: boolean;\n}\n<\/code><\/pre>\n<p>Next, we can use the Nest CLI to generate a service and controller for us:<\/p>\n<pre><code class=\"language-bash\">nest g service missions\nnest g controller missions\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"131\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestmissions.png\" alt=\"\" class=\"aligncenter size-full wp-image-2726 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/131;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"131\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestmissions.png\" alt=\"\" class=\"aligncenter size-full wp-image-2726\" \/><\/noscript><\/p>\n<p>These commands will create a controller and a service file, along with spec files for testing.<\/p>\n<p>For now, the Missions Service returns a hard-coded list of missions. Update the class in the<code>mission.service.ts<\/code> file to the following:<\/p>\n<pre><code class=\"language-typescript\">@Injectable()\nexport class MissionsService {\n  missions: Mission[] = [\n    {\n      id: 1,\n      title: &#039;Rescue cat stuck in asteroid&#039;,\n      reward: 500,\n      active: true,\n    },\n    {\n      id: 2,\n      title: &#039;Escort Royal Fleet&#039;,\n      reward: 5000,\n      active: true,\n    },\n    {\n      id: 3,\n      title: &#039;Pirates attacking the station&#039;,\n      reward: 2500,\n      active: false,\n    },\n  ];\n\n  async getMissions(): Promise&lt;Mission[]&gt; {\n    return this.missions;\n  }\n}\n<\/code><\/pre>\n<p>Here, we have a few missions defined in an array and a <code>getMissions<\/code> method, which simply returns the missions array.<\/p>\n<p>Next, update the <code>missions.controller.ts<\/code> controller to include the method that handles the GET request:<\/p>\n<pre><code class=\"language-typescript\">@Controller(&#039;missions&#039;)\nexport class MissionsController {\n  constructor(private missionsService: MissionsService) {}\n\n  @Get()\n  getMissions() {\n    return this.missionsService.getMissions();\n  }\n}\n<\/code><\/pre>\n<p>Now, if you back to your browser and visit http:\/\/localhost:3000\/missions, you should see the list of missions returned in JSON format.<\/p>\n<p>However, trying to access this data from a web app (like what we will build in a moment), you would get the following error in the browser:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"60\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniccorserror.png\" alt=\"\" class=\"aligncenter size-full wp-image-2727 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniccorserror.png 658w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniccorserror-300x27.png 300w\" data-sizes=\"auto, (max-width: 658px) 100vw, 658px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 658px; --smush-placeholder-aspect-ratio: 658\/60;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"60\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniccorserror.png\" alt=\"\" class=\"aligncenter size-full wp-image-2727\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniccorserror.png 658w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniccorserror-300x27.png 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/noscript><\/p>\n<p>This error is because the browsers same origin policy is kicking in and denying you to make an XHR request to a domain that the web page did not originate from. To get around this, we enable Cross-Origin Resource Sharing (CORS). Fortunately, Nest makes this easy, and all we have to do is open up the <code>main.ts<\/code> file and add <code>app.enableCors()<\/code> right after app is defined like so:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"145\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestenablecors.png\" alt=\"\" class=\"aligncenter size-full wp-image-2728 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestenablecors.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestenablecors-300x73.png 300w\" data-sizes=\"auto, (max-width: 600px) 100vw, 600px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/145;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"145\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestenablecors.png\" alt=\"\" class=\"aligncenter size-full wp-image-2728\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestenablecors.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/nestenablecors-300x73.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/noscript><\/p>\n<p>With that in place, we are ready to move forward making requests from our upcoming Ionic app. We will begin to build that out next.<\/p>\n<h2>Create GoSpaceRanger Ionic App<\/h2>\n<p>In your main project folder (the parent folder where we created the <code>gsr-server<\/code> Nest project), run the following command to create a new Ionic project:<\/p>\n<pre><code class=\"language-bash\">ionic start gsr-client sidemenu\n<\/code><\/pre>\n<blockquote><p>\n  When asked if you want to install the AppFlow SDK, select no.\n<\/p><\/blockquote>\n<p>This command creates an Ionic project using the side menu template. Our app consists of a simple list page and a detail page, so starting with the side menu template gives us what we need initially, and we will use the side menu itself in the future.<\/p>\n<p>Start up the development server:<\/p>\n<pre><code class=\"language-base\">ionic serve\n<\/code><\/pre>\n<p>After building the app, your browser should automatically open to http:\/\/localhost:8100\/home and show you the blank starter:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"622\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicsidemenustarter2.png\" alt=\"\" class=\"aligncenter size-full wp-image-2736 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicsidemenustarter2.png 350w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicsidemenustarter2-169x300.png 169w\" data-sizes=\"auto, (max-width: 350px) 100vw, 350px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 350px; --smush-placeholder-aspect-ratio: 350\/622;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"622\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicsidemenustarter2.png\" alt=\"\" class=\"aligncenter size-full wp-image-2736\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicsidemenustarter2.png 350w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicsidemenustarter2-169x300.png 169w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/noscript><\/p>\n<p>Let us create a new Angular service via the Ionic CLI:<\/p>\n<pre><code class=\"language-bash\">ionic g service services\/missions\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"178\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicmissionservice.png\" alt=\"\" class=\"aligncenter size-full wp-image-2730 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicmissionservice.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicmissionservice-300x89.png 300w\" data-sizes=\"auto, (max-width: 600px) 100vw, 600px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/178;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"178\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicmissionservice.png\" alt=\"\" class=\"aligncenter size-full wp-image-2730\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicmissionservice.png 600w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionicmissionservice-300x89.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/noscript><\/p>\n<p>Look familiar? This code is nearly the same as our initial Nest service (the lone difference being the <code>providedIn<\/code> option passed in the Injector, which Nest doesn&#8217;t support yet).<\/p>\n<p>In our service, we make the HTTP request to <code>\/missions<\/code> and return the data. Update the class in<code>missions.service.ts<\/code> with the following:<\/p>\n<pre><code class=\"language-typescript\">@Injectable({\n  providedIn: &#039;root&#039;\n})\nexport class MissionsService {\n  constructor(private httpClient: HttpClient) { }\n\n  getMissions() {\n    return this.httpClient.get(&#039;http:\/\/localhost:3000\/missions&#039;);\n  }\n}\n<\/code><\/pre>\n<blockquote><p>\n  Since we are using HttpClient, make sure to add HttpClientModule (from <code>@angular\/common\/http<\/code>) in the app module&#8217;s list of imports.\n<\/p><\/blockquote>\n<p>Next, modify the <code>home.page.ts<\/code> file to call into the service and save the results to a local observable:<\/p>\n<pre><code class=\"language-typescript\">export class HomePage implements OnInit {\n  missions: Observable&lt;any&gt;;\n\n  constructor(private missionsService: MissionsService) {}\n\n  ngOnInit() {\n    this.missions = this.missionsService.getMissions();\n  }\n}\n<\/code><\/pre>\n<p>And to wrap it all up, replace the <code>home.page.html<\/code> template with the following:<\/p>\n<pre><code class=\"language-html\">&lt;ion-header&gt;\n  &lt;ion-toolbar&gt;\n  &lt;ion-buttons slot=&quot;start&quot;&gt;\n      &lt;ion-menu-button&gt;&lt;\/ion-menu-button&gt;\n  &lt;\/ion-buttons&gt;\n    &lt;ion-title&gt;Missions&lt;\/ion-title&gt;\n  &lt;\/ion-toolbar&gt;\n&lt;\/ion-header&gt;\n\n&lt;ion-content&gt;\n  &lt;ion-list&gt;\n    &lt;ion-item *ngFor=&quot;let mission of (missions | async)&quot;&gt;\n      &lt;ion-label&gt;\n        &lt;h2&gt;{{ mission.title }}&lt;\/h2&gt;\n        &lt;p&gt;{{ mission.reward | currency }}&lt;\/p&gt;\n      &lt;\/ion-label&gt;\n      &lt;ion-icon slot=&quot;start&quot; icon=&quot;rocket&quot; color=&quot;primary&quot;&gt;&lt;\/ion-icon&gt;\n    &lt;\/ion-item&gt;\n  &lt;\/ion-list&gt;\n&lt;\/ion-content&gt;\n<\/code><\/pre>\n<p>Here, we have a reasonably simple Ionic page with a list that displays a few list items, each one with one of the missions coming back from the Nest API.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"622\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniclistpage2.png\" alt=\"\" class=\"aligncenter size-full wp-image-2735 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniclistpage2.png 350w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniclistpage2-169x300.png 169w\" data-sizes=\"auto, (max-width: 350px) 100vw, 350px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 350px; --smush-placeholder-aspect-ratio: 350\/622;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"622\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniclistpage2.png\" alt=\"\" class=\"aligncenter size-full wp-image-2735\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniclistpage2.png 350w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ioniclistpage2-169x300.png 169w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/noscript><\/p>\n<p>Now that our space rangers can view their missions, we will wrap part one of this series. So far, we&#8217;ve done a lot: We learned why TypeScript is beneficial not only on the client side but also on the server side. We also learned how to leverage the power of TypeScript on Node by using the Nest framework. And, we built a simple yet functional Ionic app that displays data served up from the Nest API. Exciting stuff!<\/p>\n<p>If you would like to download what we have completed so far, grab the code on <a href=\"https:\/\/github.com\/ionic-team\/demo-ionic-nest-tutorial\" rel=\"noopenner noopener\" target=\"_blank\">GitHub<\/a>.<\/p>\n<p><a href=\"https:\/\/ionicframework.com\/full-stack-typescript-with-ionic-angular-and-nestjs-part-2\/\" target=\"_blank\" rel=\"noopener\">In part two<\/a>, we dive deeper into the various building blocks Nest gives us and build out more of our API.<\/p>\n<p>Happy Coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Welcome to the first post in a new series we\u2019re kicking off all about building a full stack TypeScript app using Ionic, Angular and NestJS. TypeScript is a powerful language that is a superset of JavaScript, with some additional features added to help build out large scale applications. One of my favorite features of [&hellip;]<\/p>\n","protected":false},"author":66,"featured_media":2732,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"","publish_post_category":"","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"","discourse_permalink":"","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[121],"tags":[60,3,148],"class_list":["post-2720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engineering","tag-angular","tag-ionic","tag-nest"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1 - Ionic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1\" \/>\n<meta property=\"og:description\" content=\"Introduction Welcome to the first post in a new series we\u2019re kicking off all about building a full stack TypeScript app using Ionic, Angular and NestJS. TypeScript is a powerful language that is a superset of JavaScript, with some additional features added to help build out large scale applications. One of my favorite features of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-11T16:47:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-15T22:31:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"798\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ely Lucas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@elylucas\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ely Lucas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1\"},\"author\":{\"name\":\"Ely Lucas\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b\"},\"headline\":\"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1\",\"datePublished\":\"2019-04-11T16:47:33+00:00\",\"dateModified\":\"2020-10-15T22:31:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1\"},\"wordCount\":1971,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png\",\"keywords\":[\"Angular\",\"Ionic\",\"Nest\"],\"articleSection\":[\"Engineering\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1\",\"url\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1\",\"name\":\"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1 - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png\",\"datePublished\":\"2019-04-11T16:47:33+00:00\",\"dateModified\":\"2020-10-15T22:31:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png\",\"width\":1440,\"height\":798},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b\",\"name\":\"Ely Lucas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g\",\"caption\":\"Ely Lucas\"},\"sameAs\":[\"https:\/\/x.com\/elylucas\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/ely\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1 - Ionic Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1","og_locale":"en_US","og_type":"article","og_title":"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1","og_description":"Introduction Welcome to the first post in a new series we\u2019re kicking off all about building a full stack TypeScript app using Ionic, Angular and NestJS. TypeScript is a powerful language that is a superset of JavaScript, with some additional features added to help build out large scale applications. One of my favorite features of [&hellip;]","og_url":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1","og_site_name":"Ionic Blog","article_published_time":"2019-04-11T16:47:33+00:00","article_modified_time":"2020-10-15T22:31:35+00:00","og_image":[{"width":1440,"height":798,"url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png","type":"image\/png"}],"author":"Ely Lucas","twitter_card":"summary_large_image","twitter_creator":"@elylucas","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Ely Lucas","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1"},"author":{"name":"Ely Lucas","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b"},"headline":"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1","datePublished":"2019-04-11T16:47:33+00:00","dateModified":"2020-10-15T22:31:35+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1"},"wordCount":1971,"commentCount":0,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"image":{"@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png","keywords":["Angular","Ionic","Nest"],"articleSection":["Engineering"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1","url":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1","name":"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1 - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage"},"image":{"@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png","datePublished":"2019-04-11T16:47:33+00:00","dateModified":"2020-10-15T22:31:35+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#primaryimage","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png","width":1440,"height":798},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/full-stack-typescript-with-ionic-angular-and-nestjs-part-1#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Full-Stack TypeScript with Ionic, Angular, and NestJS Part 1"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b","name":"Ely Lucas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g","caption":"Ely Lucas"},"sameAs":["https:\/\/x.com\/elylucas"],"url":"https:\/\/ionic.io\/blog\/author\/ely"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2019\/04\/ionic-nestjs-1.png","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/2720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/66"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=2720"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/2720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media\/2732"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=2720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=2720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=2720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}