fastrax pos

1658469961

How to pick the right POS for your business?

When you’re running a retail business, it’s essential to have a point of sale system that can keep up with the demands of your customers. But with so many different retail POS systems on the market, it can be hard to know which one is right for your business. Here are a few things to keep in mind when choosing a retail POS system:  

- Ease of use: Your POS system should be easy for you and your employees. Look for a plan with a simple interface that’s easy to navigate.  

- Functionality: Make sure the POS system you choose has all the features you need, such as inventory management, customer tracking, and reporting. 

- Cost: Don’t forget to factor in the cost of the retail system, including setup and monthly fees. Choose a plan that fits your budget and offers a good return on your investment.  

- Customer support: When something goes wrong with your POS system, you want to be able to get help from a knowledgeable customer support team. Look for a company that offers 24/7 support in case of emergencies.  

How to use your POS system to manage inventory more effectively? 

If you own a retail business, you know how important it is to keep track of your inventory. A POS system can be a great way to help you manage your inventory more effectively. Retail POS system can help you keep track of what products are selling well and which ones are sitting on the shelves. You can also use your POS system to place orders for new inventory. In addition, retail point of sale software can help you track customer purchases and returns. Using your POS system to manage your inventory, you can ensure that your retail business runs more smoothly and efficiently.  

Tricks for setting up your new point of sale software  

Your retail system can be a powerful tool for managing your inventory more effectively. By keeping track of sales data, you can quickly identify which items are selling well and which are not. This information can help you decide what to order in the future and how to price items. In addition, your POS system can help you keep track of stock levels to avoid overselling or running out of items. You can streamline your inventory management and improve your bottom line by taking advantage of these features. 

What is GEEK

Buddha Community

How to pick the right POS for your business?
Carmen  Grimes

Carmen Grimes

1595491178

Best Electric Bikes and Scooters for Rental Business or Campus Facility

The electric scooter revolution has caught on super-fast taking many cities across the globe by storm. eScooters, a renovated version of old-school scooters now turned into electric vehicles are an environmentally friendly solution to current on-demand commute problems. They work on engines, like cars, enabling short traveling distances without hassle. The result is that these groundbreaking electric machines can now provide faster transport for less — cheaper than Uber and faster than Metro.

Since they are durable, fast, easy to operate and maintain, and are more convenient to park compared to four-wheelers, the eScooters trend has and continues to spike interest as a promising growth area. Several companies and universities are increasingly setting up shop to provide eScooter services realizing a would-be profitable business model and a ready customer base that is university students or residents in need of faster and cheap travel going about their business in school, town, and other surrounding areas.

Electric Scooters Trends and Statistics

In many countries including the U.S., Canada, Mexico, U.K., Germany, France, China, Japan, India, Brazil and Mexico and more, a growing number of eScooter users both locals and tourists can now be seen effortlessly passing lines of drivers stuck in the endless and unmoving traffic.

A recent report by McKinsey revealed that the E-Scooter industry will be worth― $200 billion to $300 billion in the United States, $100 billion to $150 billion in Europe, and $30 billion to $50 billion in China in 2030. The e-Scooter revenue model will also spike and is projected to rise by more than 20% amounting to approximately $5 billion.

And, with a necessity to move people away from high carbon prints, traffic and congestion issues brought about by car-centric transport systems in cities, more and more city planners are developing more bike/scooter lanes and adopting zero-emission plans. This is the force behind the booming electric scooter market and the numbers will only go higher and higher.

Companies that have taken advantage of the growing eScooter trend develop an appthat allows them to provide efficient eScooter services. Such an app enables them to be able to locate bike pick-up and drop points through fully integrated google maps.

List of Best Electric Bikes for Rental Business or Campus Facility 2020:

It’s clear that e scooters will increasingly become more common and the e-scooter business model will continue to grab the attention of manufacturers, investors, entrepreneurs. All this should go ahead with a quest to know what are some of the best electric bikes in the market especially for anyone who would want to get started in the electric bikes/scooters rental business.

We have done a comprehensive list of the best electric bikes! Each bike has been reviewed in depth and includes a full list of specs and a photo.

Billy eBike

mobile-best-electric-bikes-scooters https://www.kickstarter.com/projects/enkicycles/billy-were-redefining-joyrides

To start us off is the Billy eBike, a powerful go-anywhere urban electric bike that’s specially designed to offer an exciting ride like no other whether you want to ride to the grocery store, cafe, work or school. The Billy eBike comes in 4 color options – Billy Blue, Polished aluminium, Artic white, and Stealth black.

Price: $2490

Available countries

Available in the USA, Europe, Asia, South Africa and Australia.This item ships from the USA. Buyers are therefore responsible for any taxes and/or customs duties incurred once it arrives in your country.

Features

  • Control – Ride with confidence with our ultra-wide BMX bars and a hyper-responsive twist throttle.
  • Stealth- Ride like a ninja with our Gates carbon drive that’s as smooth as butter and maintenance-free.
  • Drive – Ride further with our high torque fat bike motor, giving a better climbing performance.
  • Accelerate – Ride quicker with our 20-inch lightweight cutout rims for improved acceleration.
  • Customize – Ride your own way with 5 levels of power control. Each level determines power and speed.
  • Flickable – Ride harder with our BMX /MotoX inspired geometry and lightweight aluminum package

Specifications

  • Maximum speed: 20 mph (32 km/h)
  • Range per charge: 41 miles (66 km)
  • Maximum Power: 500W
  • Motor type: Fat Bike Motor: Bafang RM G060.500.DC
  • Load capacity: 300lbs (136kg)
  • Battery type: 13.6Ah Samsung lithium-ion,
  • Battery capacity: On/off-bike charging available
  • Weight: w/o batt. 48.5lbs (22kg), w/ batt. 54lbs (24.5kg)
  • Front Suspension: Fully adjustable air shock, preload/compression damping /lockout
  • Rear Suspension: spring, preload adjustment
  • Built-in GPS

Why Should You Buy This?

  • Riding fun and excitement
  • Better climbing ability and faster acceleration.
  • Ride with confidence
  • Billy folds for convenient storage and transportation.
  • Shorty levers connect to disc brakes ensuring you stop on a dime
  • belt drives are maintenance-free and clean (no oil or lubrication needed)

**Who Should Ride Billy? **

Both new and experienced riders

**Where to Buy? **Local distributors or ships from the USA.

Genze 200 series e-Bike

genze-best-electric-bikes-scooters https://www.genze.com/fleet/

Featuring a sleek and lightweight aluminum frame design, the 200-Series ebike takes your riding experience to greater heights. Available in both black and white this ebike comes with a connected app, which allows you to plan activities, map distances and routes while also allowing connections with fellow riders.

Price: $2099.00

Available countries

The Genze 200 series e-Bike is available at GenZe retail locations across the U.S or online via GenZe.com website. Customers from outside the US can ship the product while incurring the relevant charges.

Features

  • 2 Frame Options
  • 2 Sizes
  • Integrated/Removable Battery
  • Throttle and Pedal Assist Ride Modes
  • Integrated LCD Display
  • Connected App
  • 24 month warranty
  • GPS navigation
  • Bluetooth connectivity

Specifications

  • Maximum speed: 20 mph with throttle
  • Range per charge: 15-18 miles w/ throttle and 30-50 miles w/ pedal assist
  • Charging time: 3.5 hours
  • Motor type: Brushless Rear Hub Motor
  • Gears: Microshift Thumb Shifter
  • Battery type: Removable Samsung 36V, 9.6AH Li-Ion battery pack
  • Battery capacity: 36V and 350 Wh
  • Weight: 46 pounds
  • Derailleur: 8-speed Shimano
  • Brakes: Dual classic
  • Wheels: 26 x 20 inches
  • Frame: 16, and 18 inches
  • Operating Mode: Analog mode 5 levels of Pedal Assist Thrott­le Mode

Norco from eBikestore

norco-best-electric-bikes-scooters https://ebikestore.com/shop/norco-vlt-s2/

The Norco VLT S2 is a front suspension e-Bike with solid components alongside the reliable Bosch Performance Line Power systems that offer precise pedal assistance during any riding situation.

Price: $2,699.00

Available countries

This item is available via the various Norco bikes international distributors.

Features

  • VLT aluminum frame- for stiffness and wheel security.
  • Bosch e-bike system – for their reliability and performance.
  • E-bike components – for added durability.
  • Hydraulic disc brakes – offer riders more stopping power for safety and control at higher speeds.
  • Practical design features – to add convenience and versatility.

Specifications

  • Maximum speed: KMC X9 9spd
  • Motor type: Bosch Active Line
  • Gears: Shimano Altus RD-M2000, SGS, 9 Speed
  • Battery type: Power Pack 400
  • Battery capacity: 396Wh
  • Suspension: SR Suntour suspension fork
  • Frame: Norco VLT, Aluminum, 12x142mm TA Dropouts

Bodo EV

bodo-best-electric-bikes-scootershttp://www.bodoevs.com/bodoev/products_show.asp?product_id=13

Manufactured by Bodo Vehicle Group Limited, the Bodo EV is specially designed for strong power and extraordinary long service to facilitate super amazing rides. The Bodo Vehicle Company is a striking top in electric vehicles brand field in China and across the globe. Their Bodo EV will no doubt provide your riders with high-level riding satisfaction owing to its high-quality design, strength, breaking stability and speed.

Price: $799

Available countries

This item ships from China with buyers bearing the shipping costs and other variables prior to delivery.

Features

  • Reliable
  • Environment friendly
  • Comfortable riding
  • Fashionable
  • Economical
  • Durable – long service life
  • Braking stability
  • LED lighting technology

Specifications

  • Maximum speed: 45km/h
  • Range per charge: 50km per person
  • Charging time: 8 hours
  • Maximum Power: 3000W
  • Motor type: Brushless DC Motor
  • Load capacity: 100kg
  • Battery type: Lead-acid battery
  • Battery capacity: 60V 20AH
  • Weight: w/o battery 47kg

#android app #autorent #entrepreneurship #ios app #minimum viable product (mvp) #mobile app development #news #app like bird #app like bounce #app like lime #autorent #best electric bikes 2020 #best electric bikes for rental business #best electric kick scooters 2020 #best electric kickscooters for rental business #best electric scooters 2020 #best electric scooters for rental business #bird scooter business model #bird scooter rental #bird scooter rental cost #bird scooter rental price #clone app like bird #clone app like bounce #clone app like lime #electric rental scooters #electric scooter company #electric scooter rental business #how do you start a moped #how to start a moped #how to start a scooter rental business #how to start an electric company #how to start electric scooterrental business #lime scooter business model #scooter franchise #scooter rental business #scooter rental business for sale #scooter rental business insurance #scooters franchise cost #white label app like bird #white label app like bounce #white label app like lime

Carmen  Grimes

Carmen Grimes

1595494844

How to start an electric scooter facility/fleet in a university campus/IT park

Are you leading an organization that has a large campus, e.g., a large university? You are probably thinking of introducing an electric scooter/bicycle fleet on the campus, and why wouldn’t you?

Introducing micro-mobility in your campus with the help of such a fleet would help the people on the campus significantly. People would save money since they don’t need to use a car for a short distance. Your campus will see a drastic reduction in congestion, moreover, its carbon footprint will reduce.

Micro-mobility is relatively new though and you would need help. You would need to select an appropriate fleet of vehicles. The people on your campus would need to find electric scooters or electric bikes for commuting, and you need to provide a solution for this.

To be more specific, you need a short-term electric bike rental app. With such an app, you will be able to easily offer micro-mobility to the people on the campus. We at Devathon have built Autorent exactly for this.

What does Autorent do and how can it help you? How does it enable you to introduce micro-mobility on your campus? We explain these in this article, however, we will touch upon a few basics first.

Micro-mobility: What it is

micro-mobility

You are probably thinking about micro-mobility relatively recently, aren’t you? A few relevant insights about it could help you to better appreciate its importance.

Micro-mobility is a new trend in transportation, and it uses vehicles that are considerably smaller than cars. Electric scooters (e-scooters) and electric bikes (e-bikes) are the most popular forms of micro-mobility, however, there are also e-unicycles and e-skateboards.

You might have already seen e-scooters, which are kick scooters that come with a motor. Thanks to its motor, an e-scooter can achieve a speed of up to 20 km/h. On the other hand, e-bikes are popular in China and Japan, and they come with a motor, and you can reach a speed of 40 km/h.

You obviously can’t use these vehicles for very long commutes, however, what if you need to travel a short distance? Even if you have a reasonable public transport facility in the city, it might not cover the route you need to take. Take the example of a large university campus. Such a campus is often at a considerable distance from the central business district of the city where it’s located. While public transport facilities may serve the central business district, they wouldn’t serve this large campus. Currently, many people drive their cars even for short distances.

As you know, that brings its own set of challenges. Vehicular traffic adds significantly to pollution, moreover, finding a parking spot can be hard in crowded urban districts.

Well, you can reduce your carbon footprint if you use an electric car. However, electric cars are still new, and many countries are still building the necessary infrastructure for them. Your large campus might not have the necessary infrastructure for them either. Presently, electric cars don’t represent a viable option in most geographies.

As a result, you need to buy and maintain a car even if your commute is short. In addition to dealing with parking problems, you need to spend significantly on your car.

All of these factors have combined to make people sit up and think seriously about cars. Many people are now seriously considering whether a car is really the best option even if they have to commute only a short distance.

This is where micro-mobility enters the picture. When you commute a short distance regularly, e-scooters or e-bikes are viable options. You limit your carbon footprints and you cut costs!

Businesses have seen this shift in thinking, and e-scooter companies like Lime and Bird have entered this field in a big way. They let you rent e-scooters by the minute. On the other hand, start-ups like Jump and Lyft have entered the e-bike market.

Think of your campus now! The people there might need to travel short distances within the campus, and e-scooters can really help them.

How micro-mobility can benefit you

benefits-micromobility

What advantages can you get from micro-mobility? Let’s take a deeper look into this question.

Micro-mobility can offer several advantages to the people on your campus, e.g.:

  • Affordability: Shared e-scooters are cheaper than other mass transportation options. Remember that the people on your campus will use them on a shared basis, and they will pay for their short commutes only. Well, depending on your operating model, you might even let them use shared e-scooters or e-bikes for free!
  • Convenience: Users don’t need to worry about finding parking spots for shared e-scooters since these are small. They can easily travel from point A to point B on your campus with the help of these e-scooters.
  • Environmentally sustainable: Shared e-scooters reduce the carbon footprint, moreover, they decongest the roads. Statistics from the pilot programs in cities like Portland and Denver showimpressive gains around this key aspect.
  • Safety: This one’s obvious, isn’t it? When people on your campus use small e-scooters or e-bikes instead of cars, the problem of overspeeding will disappear. you will see fewer accidents.

#android app #autorent #ios app #mobile app development #app like bird #app like bounce #app like lime #autorent #bird scooter business model #bird scooter rental #bird scooter rental cost #bird scooter rental price #clone app like bird #clone app like bounce #clone app like lime #electric rental scooters #electric scooter company #electric scooter rental business #how do you start a moped #how to start a moped #how to start a scooter rental business #how to start an electric company #how to start electric scooterrental business #lime scooter business model #scooter franchise #scooter rental business #scooter rental business for sale #scooter rental business insurance #scooters franchise cost #white label app like bird #white label app like bounce #white label app like lime

Why Business Cards Printing are essential for your business

No matter how technological advancement helps in communication but business card printing still worth it. Most businesses prefer to have and share business cards to develop a direct relationship with the potential market. It is an important part of the promotional and branding strategy and effectively described the brand’s nature. It gives ease in sharing the business-related information in the public like at conference, workshops and other.

This is image title

Moreover, a quality visiting card printing online provides the impression of products or services. According to the random research, it is stated that most of the customers draw the conclusion about the business and its products from the card quality or its printing. So, a smart business card with the right size and content is essential for the business.

Here are the factors that will help to understand the importance of the business card in the brand promotion or more:

Provide Contact Details:

One of the main reasons behind business card printing is the contact sharing features. The card contains contact details, name, logo, and other related information that helps the client to reach the business. Further, it helps to describe the brand or product nature before approaching the product or services. Other than the technology usage or sharing of the information through devices, business cards are most suitable and a handy item that worth a lot for the customers.

This is image title

The impression of the Brand:

The business card is a source that will deliver the first impression of the brand or business towards the potential buyers. It is something handy with the physical touch that develops a direct relationship with the potential market. While going to print business cards that quality, printing style, and overall outlook matters a lot. Because it works as the first impression of the business and its product or services for the potential market. So, the worthy card made with durable material and have an attractive color combination or layout can capture the interest easily.

It contains the company logo, name, design, and color combination that quickly attain the interest of the audience. On other hand, it is an important factor to pay attention to while making the designing and printing decision about the business card.

Direct Marketing Facility:

No doubt there are multiple marketing and promotional tools are available for the product or business promotion. But engraved business cards online is something incredible and handy that provide the physical touch experience. It works as the marketing or promotional element that helps in sharing the details directly to the potential market. With the more physical interaction that the business cards offer to the buyers and business.

The important thing that has to be considered in making the custom business cards, related to the content adjustment, design, and color combination. It helps to capture the buyer’s interest and deliver the right impression towards them.

This is image title

Appreciated in Different Cultures:

The business cards preferably deliver the right knowledge and impression about the product or services. It described the brand position, nature of the products or services, and other relevant skills. In most cultures, it is appreciated to have and share physical business cards as an information-sharing tool. In face-to-face interaction, develops a network and promotes sharing the business information in a circle.

Ease to Provide a Business Reference:

In business cards, online people find multiple opportunities in designing and Printing Services with a significant impression. It helps to make an easy referral related to particular services and a person with a skill set. The business car not only contains the address, contact information, or brand-related knowledge. It provides details about the particular person and reflects the skill set. Multiple factors truly help to describe the right impression of the brand through color, text, and images.

A tool to Develop Trust:

For business growth and development, it is important to gain the trust level of the customers. With the custom business cards, it is easier to attain the trust of the customers. in the competitive business atmosphere for a business survival trust is the only key, that can be over the product or on a company as well. Through the business card, it is easier to exchange and share personal warmth feelings.

With Business Cards Printing, it is easier to show more graphical representation through colors and design. Moreover, with the physical touch, it is easier to give trust feelings or more.

This is image title

Final Consideration!

In the competitive business world, the business card is a source to deliver information and capture the interest of potential buyers. It helps to impress the audience and provide relevant product details and skills that build trust or act as the direct promotional tool.

#business cards printing #visiting card printing online #go print business cards #engraved business cards online #custom business cards #business cards online

POS Software Service in UK

POS Software Service in UK

We know that business people in all markets are facing new competition and are adapting their businesses to meet evolving consumer demands. Moreover purchasing a standard retail software license requires different features to support new customer engagement strategies or effectively scale their businesses to respond to changing markets.

Why it is important To Your Customers

POS Software Service is more important for customers. They are billed at a predictable monthly fee that comprises maintenance and updates, and merchants can add features or scale with more agility than with software hosted onsite.

Point of Sale Advantages: Top 10 Reasons POS Systems are better than Cash Registers

Increased Efficiency

Ease of Use

Expanded Payment Capabilities

Greater Accuracy

Inventory Management

Employee Management

Reporting

Detailed Receipts

Why POS Software Service Is an Opportunity

It is found that some payment processing companies have begun partnering with hardware and software companies to create POS-as-a-Service bundles. One major benefit of such a bundle is that the upfront costs of the solution are partially or totally covered by the participating vendors, lessening or removing the cash flow challenge for you, the solution provider.

Sales Reports

A POS system offers you a good overview of your business and keeps record of its cash flow automatically. Data about a product range can be found easily.

Save Time

Another major benefit of POS system lies in keeping track on the delivery and all goods going out of your store. The system continually conveys you how much a specific product has sold and exactly informs you on what you have in stock. This permits the POS system itself to submit orders to the suppliers when the inventory is nearly empty. So there is no need to have an employee spending time on doing it.

Final Thoughts

To summarize we can illustrate that a POS system makes your business more cost-focused, gives you a greater insight into revenues, make you save time, improves the relation with the customer and uses earlier recorded data to create economic objectives. Eventually this POS Software Service has become more important to the users and business clients.

#pos software service in uk #best pos system for small business uk #best coffee shop pos systems for cafes in the uk #pos solutions uk #software companies in london #pos software development in london

Construindo um Aplicativo Web Crud usando Angular | Angular 13 CRUD

Angular CRUD significa um aplicativo que consiste em criar, ler, atualizar e excluir funcionalidades de dados. É o guia completo sobre a construção de aplicativos da Web CRUD (Criar, Ler, Atualizar, Excluir) usando a Nova Estrutura Angular. O Angular acaba de ser lançado e vem com alguns novos recursos e melhorias.

Primeiro, instalaremos o Angular usando o Angular CLI e, em seguida, continuaremos a desenvolver o front-end e o back-end.

1: Instale o Angular e outras dependências.

Se você tiver uma versão @angular/cli mais antiga, poderá executar o comando a seguir para instalar as versões mais recentes.

npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli

Se você estiver passando por algum problema, confira meu How To Update Angular CLI To Version 7Ele o ajudará a atualizar sua CLI do Angular e você criará um novo projeto Angular seven.

Ok, agora, se você digitar o seguinte comando, poderá ver que atualizamos o Angular CLI.

Exemplo de Angular 7 CRUD |  Tutorial MEAN Stack

Agora, você criará um novo projeto Angular usando o seguinte comando.

ng new angular7crud
cd angular7crud

Exemplo MEAN Stack CRUD

Depois de entrar na pasta do projeto, abra o projeto no Visual Studio Code usando o comando a seguir. Se você não estiver usando, comece a usá-lo. É o melhor editor para desenvolvimento Javascript .

code .

No momento da instalação, habilitamos o roteamento para nosso aplicativo. É novo no Angular  porque nos avisará durante a instalação do clichê angular. Você pode verificar o arquivo chamado arquivo app-routing.module.ts  dentro do diretório src >> app .

Em seguida, instale o Bootstrap 4 CSS Framework usando o comando a seguir.

npm install bootstrap --save

Agora, adicione-o dentro do  arquivo angular.json  .

"styles": [
   "src/styles.css",
   "./node_modules/bootstrap/dist/css/bootstrap.min.css"
 ],

Então, agora podemos usar as classes do Bootstrap 4 em nosso projeto. 

Inicie o servidor de desenvolvimento Angular usando o comando a seguir.

ng serve -o

 

Passo a passo do Angular 7

Descrição do Projeto

Criaremos um projeto no qual os usuários poderão inserir seu nome de usuário  , nome comercial  e número GST no formulário e enviá-lo. Se os valores estiverem incorretos, eles serão validados no frontend e o formulário não será enviado. Por outro lado, se todos os valores parecerem perfeitos, enviaremos o formulário para a API de backend , armazenando os valores dentro do banco de dados MongoDB .

Então agora, vamos criar alguns componentes angulares para fazer o trabalho.

2: Gerar Componentes Angulares

Digite o seguinte comando para gerar Componentes Angulares . Iremos realizar operações de criação, leitura e atualização. Então vamos criar três componentes.

ng g c gst-add --spec=false
ng g c gst-get --spec=false
ng g c gst-edit --spec=false

Tutorial CRUD Angular

Todos os três componentes são registrados automaticamente dentro de um arquivo app.module.ts  . Precisamos configurar o roteamento de componentes angulares dentro de um arquivo app-routing.module.ts  .

// app-routing.module.ts

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { GstAddComponent } from './gst-add/gst-add.component';
import { GstEditComponent } from './gst-edit/gst-edit.component';
import { GstGetComponent } from './gst-get/gst-get.component';

const routes: Routes = [
  {
    path: 'business/create',
    component: GstAddComponent
  },
  {
    path: 'business/edit/:id',
    component: GstEditComponent
  },
  {
    path: 'business',
    component: GstGetComponent
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})

export class AppRoutingModule { }

Agora, você pode ver dentro do  arquivo app.component.html  que a diretiva <router-outlet>  está lá. Esta diretiva nos ajuda a renderizar os diferentes componentes com base no URI da rota.

3: Crie uma navegação angular

Escreva o código a seguir dentro do  arquivo app.component.html  .

<nav class="navbar navbar-expand-sm bg-light">
  <div class="container-fluid">
    <ul class="navbar-nav">
      <li class="nav-item">
        <a routerLink="business/create" class="nav-link" routerLinkActive="active">
          Create Business
        </a>
      </li>
      <li class="nav-item">
        <a routerLink="business" class="nav-link" routerLinkActive="active">
          Business
        </a>
      </li> 
    </ul>
  </div>
</nav>

<div class="container">
  <router-outlet></router-outlet>
</div>

Salve o arquivo e vá para o navegador e clique em dois links. Você pode ver que podemos ver os diferentes componentes com base na navegação.

4: Instale o Indicador de Progresso de Roteamento Angular.

Digite o seguinte comando para instalar a  biblioteca ng2-slim-loading-bar .

npm install ng2-slim-loading-bar --save

Portanto, se você instalar pacotes de terceiros agora, ele não será compatível com o Angular . Para preencher a lacuna entre  os pacotes Angular  e de terceiros, precisamos instalar a seguinte biblioteca. É isso.

npm install rxjs-compat --save

Agora, importe o  SlimLoadingBarModule  dentro do  arquivo app.module.ts  .

// app.module.ts

import { SlimLoadingBarModule } from 'ng2-slim-loading-bar';

imports: [
    ...
    SlimLoadingBarModule
],

O próximo passo é incluir o estilo com a biblioteca dentro do arquivo src >> styles.css  .

@import "../node_modules/ng2-slim-loading-bar/style.css";

5: Adicionando eventos do roteador.

Angular RouterModule nos fornece os seguintes módulos de eventos.

  1. NavigationStart
  2. NavigationEnd
  3. Erro de Navegação
  4. Navegação Cancelar
  5. Roteador
  6. Evento

Agora, escreva o seguinte código dentro do  arquivo app.component.ts  .

// app.component.ts

import { Component } from '@angular/core';
import {SlimLoadingBarService} from 'ng2-slim-loading-bar';
import { NavigationCancel,
        Event,
        NavigationEnd,
        NavigationError,
        NavigationStart,
        Router } from '@angular/router';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'angular7crud';
  constructor(private _loadingBar: SlimLoadingBarService, private _router: Router) {
    this._router.events.subscribe((event: Event) => {
      this.navigationInterceptor(event);
    });
  }
  private navigationInterceptor(event: Event): void {
    if (event instanceof NavigationStart) {
      this._loadingBar.start();
    }
    if (event instanceof NavigationEnd) {
      this._loadingBar.complete();
    }
    if (event instanceof NavigationCancel) {
      this._loadingBar.stop();
    }
    if (event instanceof NavigationError) {
      this._loadingBar.stop();
    }
  }
}

Ele intercepta o evento de roteamento e adiciona o componente da barra de carregamento a cada rota para que possamos ver a indicação de roteamento toda vez que alterarmos as rotas.

A alteração final para exibir o indicador de roteamento é adicionar a diretiva ng2-slim-loading-bar dentro do  arquivo app.component.html  na parte superior da página.

<ng2-slim-loading-bar color="blue"></ng2-slim-loading-bar>

<nav class="navbar navbar-expand-sm bg-light">
  <div class="container-fluid">
    <ul class="navbar-nav">
      <li class="nav-item">
        <a routerLink="business/create" class="nav-link" routerLinkActive="active">
          Create Business
        </a>
      </li>
      <li class="nav-item">
        <a routerLink="business" class="nav-link" routerLinkActive="active">
          Business
        </a>
      </li> 
    </ul>
  </div>
</nav>

<div class="container">
  <router-outlet></router-outlet>
</div>

Salve o arquivo e vá ao terminal para ver se há algum erro e se não, vá ao navegador e altere as rotas, e você pode ver que agora podemos ver o indicador de roteamento.

6: Adicione o formulário Bootstrap

Dentro do  arquivo gst-add.component.html  , adicione o seguinte  formulário bootstrap 4 .

<div class="card">
  <div class="card-body">
    <form>
      <div class="form-group">
        <label class="col-md-4">Person Name</label>
        <input type="text" class="form-control" />
      </div>
      <div class="form-group">
        <label class="col-md-4">Business Name </label>
        <input type="text" class="form-control" />
      </div>
      <div class="form-group">
        <label class="col-md-4">Business GST Number </label>
        <input type="text" class="form-control" />
      </div>
      <div class="form-group">
        <button type="submit" class="btn btn-primary">Add Business</button>
      </div>
    </form>
  </div>
</div>

Demonstração Angular 7 CRUD

7: Adicionar validação de formulário angular

Usaremos ReactiveFormsModule . Portanto, se você é novo no Angular Form Validation , confira meu artigo Angular Form Validation  neste blog.

Agora, importe o  ReactiveFormsModule  dentro do  arquivo app.module.ts  .

// app.module.ts

import { ReactiveFormsModule } from '@angular/forms';

imports: [
    ...
    ReactiveFormsModule
],

Agora, precisamos escrever o código para o  arquivo app.component.ts  . Lembre-se, este não é um formulário orientado por modelo. Então vamos mudar o código dentro do arquivo app.component.ts  .

Primeiro, importamos os  módulos FormGroup, FormBuilder, Validators  de  @angular/forms .

Além disso, crie um construtor e instancie o  FormBuilder .

Então escreva o seguinte código dentro do  arquivo gst-add.component.ts  .

// gst-add.component.ts

import { Component, OnInit } from '@angular/core';
import { FormGroup,  FormBuilder,  Validators } from '@angular/forms';

@Component({
  selector: 'app-gst-add',
  templateUrl: './gst-add.component.html',
  styleUrls: ['./gst-add.component.css']
})
export class GstAddComponent implements OnInit {

  angForm: FormGroup;
  constructor(private fb: FormBuilder) {
    this.createForm();
  }

  createForm() {
    this.angForm = this.fb.group({
      person_name: ['', Validators.required ],
      business_name: ['', Validators.required ],
      business_gst_number: ['', Validators.required ]
    });
  }

  ngOnInit() {
  }

}

Usamos o construtor de formulários para lidar com toda a validação. Então, nesse construtor, estamos criando um formulário com as regras de validação. Em nosso exemplo, existem três campos. Se o texto de entrada estiver vazio, ele dará um erro e precisamos exibi-lo.

Agora, escreva o seguinte código dentro do  arquivo gst-add.component.html  .

<div class="card">
  <div class="card-body">
    <form [formGroup]="angForm" novalidate>
      <div class="form-group">
        <label class="col-md-4">Person Name</label>
        <input type="text" class="form-control" formControlName="person_name" #person_name />
      </div>
      <div *ngIf="angForm.controls['person_name'].invalid && (angForm.controls['person_name'].dirty || angForm.controls['person_name'].touched)" class="alert alert-danger">
        <div *ngIf="angForm.controls['person_name'].errors.required">
          Person Name is required.
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Business Name </label>
        <input type="text" class="form-control" formControlName="business_name" #business_name />
      </div>
      <div *ngIf="angForm.controls['business_name'].invalid && (angForm.controls['business_name'].dirty || angForm.controls['business_name'].touched)" class="alert alert-danger">
        <div *ngIf="angForm.controls['business_name'].errors.required">
          Person Business is required.
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Business GST Number </label>
        <input type="text" class="form-control" formControlName="business_gst_number" #business_gst_number />
      </div>
      <div *ngIf="angForm.controls['business_gst_number'].invalid && (angForm.controls['business_gst_number'].dirty || angForm.controls['business_gst_number'].touched)" class="alert alert-danger">
        <div *ngIf="angForm.controls['business_gst_number'].errors.required">
          Business GST Number is required.
        </div>
      </div>
      <div class="form-group">
        <button type="submit" 
        [disabled]="angForm.pristine || angForm.invalid" 
        class="btn btn-primary">Add Business</button>
      </div>
    </form>
  </div>
</div>

Salve o arquivo e vá para o navegador, e você pode ver se não colocar nenhum valor dentro da caixa de entrada, verá os erros.

Exemplo de validação de formulário Angular 7

8: Configure o HttpClientModule

Importe o  HttpClientModule  dentro do  arquivo app.module.ts  .

// app.module.ts

import { HttpClientModule } from '@angular/common/http';

imports: [
   ...
    HttpClientModule
 ],

9: Crie um modelo.

Dentro da  pasta src >> app  , crie um arquivo chamado  Business.ts  e adicione o seguinte código.

// Business.ts

export default class Business {
  person_name: String;
  business_name: String;
  business_gst_number: Number;
}

10: Crie um arquivo Angular Service.

Digite o comando a seguir para gerar o arquivo de serviço.

ng g service business --spec=false

Portanto, seu  arquivo business.service.ts  principal se parece com isso.

// business.service.ts

import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class BusinessService {

  constructor() { }
}

Agora, importe o  arquivo business.service.ts  para o  arquivo app.module.ts  .

// app.module.ts

import { BusinessService } from './business.service';

providers: [ BusinessService ],

11: Envie os dados para o servidor do nó

Precisamos escrever o código que enviará a solicitação HTTP POST com os dados para o servidor Node.js e salvar os dados no banco de dados MongoDB .

Escreva o código a seguir dentro do  arquivo business.service.ts  .

// business.service.ts

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class BusinessService {

  uri = 'http://localhost:4000/business';

  constructor(private http: HttpClient) { }

  addBusiness(person_name, business_name, business_gst_number) {
    const obj = {
      person_name: person_name,
      business_name: business_name,
      business_gst_number: business_gst_number
    };
    console.log(obj);
    this.http.post(`${this.uri}/add`, obj)
        .subscribe(res => console.log('Done'));
  }
}

Definimos nosso URL de API de back-end, mas ainda não criamos nenhum back-end, mas faremos isso em algumas etapas.

Precisamos adicionar o evento click ao botão Add Business. Portanto, adicione o seguinte código dentro do arquivo gst-add.component.html  .

<div class="form-group">
    <button (click)="addBusiness(person_name.value, business_name.value, business_gst_number.value)"
        [disabled]="angForm.pristine || angForm.invalid" 
        class="btn btn-primary">
        Add Business
     </button>
</div>

Assim, quando não houver erros, podemos enviar o formulário e ele chamará a  função addBusiness  do componente . A partir daí, chamaremos o serviço angular e o serviço enviará a solicitação HTTP Post para o servidor Node.js.

Agora, adicione a  função addBusiness  dentro do  arquivo gst-add.component.ts  . Então escreva o seguinte código dentro  do arquivo gst-add.component.ts  .

// gst-add.component.ts

import { Component, OnInit } from '@angular/core';
import { FormGroup,  FormBuilder,  Validators } from '@angular/forms';
import { BusinessService } from '../business.service';

@Component({
  selector: 'app-gst-add',
  templateUrl: './gst-add.component.html',
  styleUrls: ['./gst-add.component.css']
})
export class GstAddComponent implements OnInit {

  angForm: FormGroup;
  constructor(private fb: FormBuilder, private bs: BusinessService) {
    this.createForm();
  }

  createForm() {
    this.angForm = this.fb.group({
      person_name: ['', Validators.required ],
      business_name: ['', Validators.required ],
      business_gst_number: ['', Validators.required ]
    });
  }

  addBusiness(person_name, busines_name, business_gst_number) {
    this.bs.addBusiness(person_name, busines_name, business_gst_number);
  }

  ngOnInit() {
  }

}

Aqui, definimos a função e também importamos o  arquivo business.service.ts  . Em seguida, instancie o objeto dentro do construtor e chame a função do arquivo businsess.service.ts .

Já codificamos a  função addBusiness  dentro do  arquivo business.service.ts  . Agora, precisamos configurar a API de back-end.

12: Crie uma API de back-end Node.js

Dentro da pasta raiz angular, crie uma pasta chamada api e entre nessa pasta. Lembre-se, será um projeto completamente separado do Angular. Portanto, seus node_modules são diferentes de um Angular .

Abra o terminal dentro da  pasta api  e digite o seguinte comando.

npm init -y

Instale os seguintes módulos específicos do nó.

npm install --save express body-parser cors mongoose

Eu não reinicio o servidor do nó toda vez; Eu altero o arquivo. Então estou instalando o servidor nodemon. O que ele faz é que quando modifico o arquivo server.js  , ele reinicia o  servidor node.js  automaticamente.

npm install nodemon --save-dev

Agora, dentro da  pasta  api  , crie um arquivo chamado arquivo server.js  .

// server.js

const express = require('express'),
    path = require('path'),
    bodyParser = require('body-parser'),
    cors = require('cors'),
    mongoose = require('mongoose');

    const app = express();
    let port = process.env.PORT || 4000;

    const server = app.listen(function(){
        console.log('Listening on port ' + port);
    });

A próxima coisa é conectar o banco de dados MongoDB com nosso aplicativo node.js.

Se você não instalou o banco de dados MongoDB, instale-o e inicie o servidor mongodb.

Digite o seguinte comando para iniciar o   servidor MongoDB .

mongod

Então, agora, eu me conectei ao banco de dados.

Crie um arquivo chamado  DB.js  dentro  da pasta do projeto raiz da API  . Em seguida, escreva o código a seguir dentro do arquivo DB.js. 

// DB.js

module.exports = {
    DB: 'mongodb://localhost:27017/ng7crud'
 };

Importe este  arquivo DB.js  dentro do nosso  arquivo server.js e use a  biblioteca mongoose  para configurar a  conexão do banco de dados  com  o MongoDB . Também podemos usar o Mongoose para salvar os dados no banco de dados usando o Mongoose ORM.

Escreva o código a seguir dentro do arquivo server.js  para conectar nosso  aplicativo  MongoDB  ao servidor Node.js. 

// server.js

const express = require('express'),
    path = require('path'),
    bodyParser = require('body-parser'),
    cors = require('cors'),
    mongoose = require('mongoose'),
    config = require('./DB');

    mongoose.Promise = global.Promise;
    mongoose.connect(config.DB, { useNewUrlParser: true }).then(
      () => {console.log('Database is connected') },
      err => { console.log('Can not connect to the database'+ err)}
    );

    const app = express();
    app.use(bodyParser.json());
    app.use(cors());
    const port = process.env.PORT || 4000;

    const server = app.listen(port, function(){
     console.log('Listening on port ' + port);
    });

Salve o arquivo e vá para o terminal e inicie o servidor do nó.

nodemon server

Então, agora, você tem três servidores em execução.

  1. Servidor de Desenvolvimento Angular
  2. Servidor Nodemon
  3. Servidor MongoDB

Lembre-se, todos os três servidores estão funcionando bem sem nenhum erro; caso contrário, nosso aplicativo não funcionará.

Etapa 13: Crie um modelo e rotas para nosso aplicativo.

Precisamos criar duas pastas dentro da pasta raiz da api chamadas rotas e modelos .

Na pasta dos modelos  , crie um modelo chamado  Business.js.

// Business.js

const mongoose = require('mongoose');
const Schema = mongoose.Schema;

// Define collection and schema for Business
let Business = new Schema({
  person_name: {
    type: String
  },
  business_name: {
    type: String
  },
  business_gst_number: {
    type: Number
  }
},{
    collection: 'business'
});

module.exports = mongoose.model('Business', Business);

Assim, definimos nosso esquema para a coleção de negócios. Temos três campos chamados  person_name, business_name, business_gst_number.

Na  pasta de rotas  , crie um arquivo chamado business.route.js.

Escreva o código CRUD dentro do  arquivo business.route.js  .

// business.route.js

const express = require('express');
const app = express();
const businessRoutes = express.Router();

// Require Business model in our routes module
let Business = require('../models/Business');

// Defined store route
businessRoutes.route('/add').post(function (req, res) {
  let business = new Business(req.body);
  business.save()
    .then(business => {
      res.status(200).json({'business': 'business in added successfully'});
    })
    .catch(err => {
    res.status(400).send("unable to save to database");
    });
});

// Defined get data(index or listing) route
businessRoutes.route('/').get(function (req, res) {
    Business.find(function (err, businesses){
    if(err){
      console.log(err);
    }
    else {
      res.json(businesses);
    }
  });
});

// Defined edit route
businessRoutes.route('/edit/:id').get(function (req, res) {
  let id = req.params.id;
  Business.findById(id, function (err, business){
      res.json(business);
  });
});

//  Defined update route
businessRoutes.route('/update/:id').post(function (req, res) {
    Business.findById(req.params.id, function(err, next, business) {
    if (!business)
      return next(new Error('Could not load Document'));
    else {
        business.person_name = req.body.person_name;
        business.business_name = req.body.business_name;
        business.business_gst_number = req.body.business_gst_number;

        business.save().then(business => {
          res.json('Update complete');
      })
      .catch(err => {
            res.status(400).send("unable to update the database");
      });
    }
  });
});

// Defined delete | remove | destroy route
businessRoutes.route('/delete/:id').get(function (req, res) {
    Business.findByIdAndRemove({_id: req.params.id}, function(err, business){
        if(err) res.json(err);
        else res.json('Successfully removed');
    });
});

module.exports = businessRoutes;

Usamos o modelo mangusto para salvar, atualizar e excluir o banco de dados. Mongoose é um ORM usado no banco de dados MongoDB . Temos todas as operações CRUD configuradas no arquivo de rota; precisamos importá-los dentro do arquivo server.js  .

Então, nosso  arquivo server.js  final se parece com isso.

// server.js

const express = require('express'),
    path = require('path'),
    bodyParser = require('body-parser'),
    cors = require('cors'),
    mongoose = require('mongoose'),
    config = require('./DB');

const businessRoute = require('./routes/business.route');
mongoose.Promise = global.Promise;
mongoose.connect(config.DB, { useNewUrlParser: true }).then(
  () => {console.log('Database is connected') },
  err => { console.log('Can not connect to the database'+ err)}
);

const app = express();
app.use(bodyParser.json());
app.use(cors());
app.use('/business', businessRoute);
const port = process.env.PORT || 4000;

const server = app.listen(port, function(){
  console.log('Listening on port ' + port);
});

Etapa 14: testar a funcionalidade de dados da loja

Se todos os servidores estiverem funcionando, você pode acessar o navegador, preencher os dados do formulário e adicionar o negócio. Você pode ver algo assim na tela se for bem-sucedido.

Agora, podemos verificar o banco de dados usando os seguintes comandos.

Primeiro, abra o shell mongo na 4ª guia porque todas as outras três guias estão ocupadas no momento.

mongo

Aqui, podemos ver que os valores são armazenados no banco de dados MongoDB. Sim!! Nós conseguimos.

Agora, as operações restantes são Ler, Atualizar e Excluir.

15: Exiba os dados no frontend

No arquivo gst-get.component.html  , escreva o código a seguir.

<table class="table table-hover">
  <thead>
  <tr>
      <td>Person Name</td>
      <td>Business Name</td>
      <td>GST Number</td>
      <td colspan="2">Actions</td>
  </tr>
  </thead>

  <tbody>
      <tr *ngFor="let business of businesses">
          <td>{{ business.person_name }}</td>
          <td>{{ business.business_name }}</td>
          <td>{{ business.business_gst_number }}</td>
          <td><a [routerLink]="['/edit', business._id]" class="btn btn-primary">Edit</a></td>
          <td><a [routerLink]="" class="btn btn-danger">Delete</a></td>
      </tr>
  </tbody>
</table>

Agora, dentro do  arquivo business.service.ts  , precisamos escrever a função buscando os dados de negócios do  banco de dados MongoDB e exibindo-os na aplicação Angular .

// business.service.ts

getBusinesses() {
    return this
           .http
           .get(`${this.uri}`);
  }

Precisamos incluir este arquivo business.service.ts  e o arquivo Business.ts  dentro do arquivo  gst-get.component.ts  .

Escreva o seguinte código dentro do  arquivo gst-get.component.ts  .

// gst-get.component.ts

import { Component, OnInit } from '@angular/core';
import Business from '../Business';
import { BusinessService } from '../business.service';

@Component({
  selector: 'app-gst-get',
  templateUrl: './gst-get.component.html',
  styleUrls: ['./gst-get.component.css']
})
export class GstGetComponent implements OnInit {

  businesses: Business[];

  constructor(private bs: BusinessService) { }

  ngOnInit() {
    this.bs
      .getBusinesses()
      .subscribe((data: Business[]) => {
        this.businesses = data;
    });
  }
}

Salve o arquivo, vá para o navegador e mude para este URL:  http://localhost:4200/business. Você pode ver a listagem das empresas.

16: Editar e atualizar dados

Ok, primeiro, precisamos buscar os dados do banco de dados MongoDB usando _idwise e exibir esses dados no arquivo gst-edit.component.html  .

Então, primeiro, escreva o seguinte código dentro do  arquivo gst-edit.component.ts  .

// gst-edit.component.ts

import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { FormGroup,  FormBuilder,  Validators } from '@angular/forms';
import { BusinessService } from '../business.service';

@Component({
  selector: 'app-gst-edit',
  templateUrl: './gst-edit.component.html',
  styleUrls: ['./gst-edit.component.css']
})
export class GstEditComponent implements OnInit {

  business: any = {};
  angForm: FormGroup;

  constructor(private route: ActivatedRoute,
    private router: Router,
    private bs: BusinessService,
    private fb: FormBuilder) {
      this.createForm();
 }

  createForm() {
    this.angForm = this.fb.group({
        person_name: ['', Validators.required ],
        business_name: ['', Validators.required ],
        business_gst_number: ['', Validators.required ]
      });
    }


  ngOnInit() {
    this.route.params.subscribe(params => {
        this.bs.editBusiness(params['id']).subscribe(res => {
          this.business = res;
      });
    });
  }
}

Aqui, quando o  componente gst-  edit.ts for renderizado, ele chamará o  método ngOnInit  e enviará uma solicitação HTTP para o servidor do nó e buscará os dados de um _id para exibir dentro do  arquivo gst-edit.component.html  .

Agora, dentro do  arquivo business.service.ts  , precisamos codificar a  função editBusiness  para enviar uma requisição HTTP.

// business.service.ts

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class BusinessService {

  uri = 'http://localhost:4000/business';

  constructor(private http: HttpClient) { }

  addBusiness(person_name, business_name, business_gst_number) {
    const obj = {
      person_name: person_name,
      business_name: business_name,
      business_gst_number: business_gst_number
    };
    this.http.post(`${this.uri}/add`, obj)
        .subscribe(res => console.log('Done'));
  }

  getBusinesses() {
    return this
           .http
           .get(`${this.uri}`);
  }

  editBusiness(id) {
    return this
            .http
            .get(`${this.uri}/edit/${id}`);
    }
}

Finalmente, precisamos escrever o formulário dentro do arquivo gst-edit.component.html  .

<div class="card">
  <div class="card-body">
    <form [formGroup]="angForm" novalidate>
      <div class="form-group">
        <label class="col-md-4">Person Name</label>
        <input type="text" class="form-control" formControlName="person_name" #person_name [(ngModel)] = "business.person_name" />
      </div>
      <div *ngIf="angForm.controls['person_name'].invalid && (angForm.controls['person_name'].dirty || angForm.controls['person_name'].touched)" class="alert alert-danger">
        <div *ngIf="angForm.controls['person_name'].errors.required">
          Person Name is required.
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Business Name </label>
        <input type="text" class="form-control" formControlName="business_name" #business_name [(ngModel)] = "business.business_name" />
      </div>
      <div *ngIf="angForm.controls['business_name'].invalid && (angForm.controls['business_name'].dirty || angForm.controls['business_name'].touched)" class="alert alert-danger">
        <div *ngIf="angForm.controls['business_name'].errors.required">
          Person Business is required.
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Business GST Number </label>
        <input type="text" class="form-control" formControlName="business_gst_number" #business_gst_number [(ngModel)] = "business.business_gst_number" />
      </div>
      <div *ngIf="angForm.controls['business_gst_number'].invalid && (angForm.controls['business_gst_number'].dirty || angForm.controls['business_gst_number'].touched)" class="alert alert-danger">
        <div *ngIf="angForm.controls['business_gst_number'].errors.required">
          Business GST Number is required.
        </div>
      </div>
      <div class="form-group">
        <button (click)="updateBusiness(person_name.value, business_name.value, business_gst_number.value)"
        [disabled]="angForm.invalid" 
        class="btn btn-primary">Update Business</button>
      </div>
    </form>
  </div>
</div>

Salve o arquivo, vá para a página de listagem, clique no botão editar e veja o formulário preenchido do banco de dados.

Você também pode ver o aviso como o seguinte. Ignore este tutorial de demonstração.

forms.js:1193
Parece que você está usando ngModel no mesmo campo de formulário que formControlName.
O suporte para usar a propriedade de entrada ngModel e o evento ngModelChange com
diretivas de formulário reativas foi preterido no Angular v6 e removido
no Angular v7.

Agora, atualize os dados. Dentro do arquivo  business.service.ts  , precisamos escrever a função que atualiza os dados.

// business.service.ts

updateBusiness(person_name, business_name, business_gst_number, id) {

    const obj = {
        person_name: person_name,
        business_name: business_name,
        business_gst_number: business_gst_number
      };
    this
      .http
      .post(`${this.uri}/update/${id}`, obj)
      .subscribe(res => console.log('Done'));
  }

Ok, agora escreva a  função updateBusiness()  dentro do arquivo gst-edit.component.ts  .

// gst-edit.component.ts

updateBusiness(person_name, business_name, business_gst_number) {
   this.route.params.subscribe(params => {
      this.bs.updateBusiness(person_name, business_name, business_gst_number, params['id']);
      this.router.navigate(['business']);
});

Salve o arquivo e você poderá atualizar os dados.

17: Exclua os dados.

Portanto, se você não encontrar nenhum erro no console, poderá atualizar os dados com êxito.

Já escrevi um serviço de edição atualização  para fazer chamadas de API. Então, até agora, Create, Read, Update  está completo neste  Angular CRUD Example . Agora, dê uma olhada em  Excluir .

Precisamos definir o evento click no botão delete dentro do arquivo  gst-get.component.html  .

<tr *ngFor="let business of businesses">
          <td>{{ business.person_name }}</td>
          <td>{{ business.business_name }}</td>
          <td>{{ business.business_gst_number }}</td>
          <td><a [routerLink]="['edit', business._id]" class="btn btn-primary">Edit</a></td>
          <td><a (click) = "deleteBusiness(business._id)" class="btn btn-danger">Delete</a></td>
</tr>

Agora, escreva a  função deleteBusiness  dentro do  arquivo gst-get.component.ts  .

// gst-get.component.ts

deleteBusiness(id) {
    this.bs.deleteBusiness(id).subscribe(res => {
      console.log('Deleted');
    });
  }

Por fim, crie a função deleteBusiness()  dentro do arquivo business.service.ts  .

// business.service.ts

deleteBusiness(id) {
    return this
              .http
              .get(`${this.uri}/delete/${id}`);
  }

Por fim, completei a funcionalidade de exclusão.

Portanto, neste tutorial, concluímos a funcionalidade CRUD em Angular.