“Places2Go” and the MEAN Stack (III)

Source Code

Let´s start

Step 01: Add a Classe (Model)

$ ng generate class services/user.model
<tbody *ngIf="users.length">
<tr *ngFor="let user of users">
<th scope="row">{{ user.id }}</th>
<td>{{ user.firstName }}</td>
<td>{{ user.lastName }}</td>
<td>{{ user.userName }}</td>
</tr>
</tbody>
<tbody *ngIf="!users.length">
<tr>
<th scope="row" colspan="4">no user!</th>
</tr>
</tbody>

Step 02: Add a Services (Model)

$ ng generate service <path-to-service/name>--flat : "--flat false" to indicate if a dir is created--spec specifies if a spec (testing file) file is generated--module (-m) allows specification of the declaring module$ ng generate --help service 
Let´s generate a dir “services” with the services inside: “services/data”$ ng generate service services/data --flat true --spec trueor the same is: by default is flat and generate spec file$ ng generate service services/data 

References

--

--

--

#cloud . #mobile ~} Sharing IT while learning It! ... Opinions are for my own

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Search Bar in React JS in Six Simple Steps

Building a Color Tool With Vanilla HTML, CSS, and JavaScript: Part Five

Creating our first component on ReactJS and uploading it on Now.sh

Build a Realtime PWA with React

Asynchronous programming in NodeJS

Let’s Make Something

The inside of a Meldorf player piano from the 1920s.

How to Create a JavaScript Package in 2019?

How to solve Leetcode No. 1492: kth Factor of N in JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pablo Ezequiel Inchausti

Pablo Ezequiel Inchausti

#cloud . #mobile ~} Sharing IT while learning It! ... Opinions are for my own

More from Medium

Application frameworks on my point of view

Let’s learn what is KOA.JS…?

Why is it necessary to learn about MongoDB as a developer?

How To Hire ReactJS Developers For Enterprise App Development