DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest JavaScript Topics

article thumbnail
How to Use Bootstrap Carousel in React
In this article, we'll demonstrate how to create a Carousel to display images and video in React with Bootstrap.
April 17, 2020
by Sanwar Ranwa DZone Core CORE
· 30,789 Views · 4 Likes
article thumbnail
Alexa Skill With TypeScript
in this article, we demonstrate how to create a custom Alexa Skill application with Node.js, TypeScript, and AWS Lambda Functions.
April 16, 2020
by Xavier Portilla Edo DZone Core CORE
· 11,011 Views · 4 Likes
article thumbnail
Building Micro-Frontends With Single-spa, React, and Vue
In this article, we discuss how to build micro-frontends with Single-spa React and Vue in order to better manage the components of our application.
April 16, 2020
by Mayur Ingle
· 23,864 Views · 9 Likes
article thumbnail
Create a CRUD App With React, Kotlin, and Spring Boot
This in-depth tutorial will go over how to create a secure CRUD application using a combination of ReactJS, Kotlin, Spring Boot, and OpenID.
April 15, 2020
by Andrew Hughes
· 32,661 Views · 30 Likes
article thumbnail
REST API Design Best Practices for Parameters and Query String Usage
In this article, take a look at REST API design best practices for parameters and query string usage.
April 10, 2020
by Kay Ploesser
· 85,488 Views · 9 Likes
article thumbnail
Create a Beautiful Login Form With Angular Material
This Angular Material tutorial will help you craft a great login form that includes single sign-on capabilities, provided by Okta in this example.
April 3, 2020
by Holger Schmitz
· 98,897 Views · 7 Likes
article thumbnail
Implement a Password Strength Meter in Angular 8
In this article, we discuss how to create a password strength meter in Angular to allow users to get feedback on the strength of potential passwords.
April 2, 2020
by Siddharth Gajbhiye
· 23,001 Views · 6 Likes
article thumbnail
Validation Forms in Vue.js Apps Using Vuelidate library
In this article, we discuss how to use Vuelidate, a Vue.js form validation module to keep you from rewriting simple validation code.
April 1, 2020
by Yuri Mednikov
· 16,536 Views · 3 Likes
article thumbnail
A Step-by-Step Guide to JavaScript Localization
Today it's time to talk about front-end. In this article we will discuss how to localize JavaScript applications using the following solutions.
Updated April 1, 2020
by Ilya Bodrov
· 37,558 Views · 13 Likes
article thumbnail
How To Copy Text to Clipboard Using Angular 8
In this article, we discuss how to copy text as well as the current date and time to our clipboard in an Angular 8 application
April 1, 2020
by Siddharth Gajbhiye
· 45,736 Views · 4 Likes
article thumbnail
Server-Side Pagination Using ASP.NET Core and Angular 8 - Part Three
In the final installment of this three-part series, we discuss how to fetch, sort, and display records from our database more efficiently.
April 1, 2020
by Siddharth Gajbhiye
· 11,453 Views · 3 Likes
article thumbnail
Angular8 + PrimeNG Tutorial — Implement a Data Table Component
In this article, we discuss how to create a DataTable component with Angular and PrimeNG to better visualize data on a webpage.
March 23, 2020
by Nazia Shaikh
· 42,396 Views · 3 Likes
article thumbnail
React Bootstrap Table With Searching and Custom Pagination
In this article, we discuss how to use the React Bootstrap Table and add pagination, searching, and sorting.
March 20, 2020
by Sanwar Ranwa DZone Core CORE
· 40,407 Views · 4 Likes
article thumbnail
How to Build a CRUD Application Using React and Django
This article demonstrates how to build a simple REST API using the Django framework, and a frontend in React which consumes the API.
March 20, 2020
by George Anderson
· 28,470 Views · 11 Likes
article thumbnail
Using a Raspberry Pi as Your Development Server
In this tutorial, I will show you how to set up a Raspberry Pi 4 as a development (or testing) server.
March 19, 2020
by Jeremy Morgan
· 53,919 Views · 14 Likes
article thumbnail
Angular Localization and Internationalization
Learn how to easily do Angular localization with built-in or external libraries. We show you how to work with angular-i18n and ngx-translate.
Updated March 16, 2020
by Tim Leers
· 56,591 Views · 7 Likes
article thumbnail
Develop a Secure CRUD Application Using Angular and Spring Boot
In this article, we discuss how to implement OpenID Connect with Angular, Kotlin, Spring Boot, and Okta.
Updated March 11, 2020
by Matt Raible
· 20,464 Views · 6 Likes
article thumbnail
Immutability in JavaScript — When and Why Should You Use It
In this article, take a look at immutability in JavaScript and see when and why you should use it.
March 10, 2020
by Manjunath M
· 39,233 Views · 3 Likes
article thumbnail
Deploying an Angular App to AWS S3
In this article, you'll create and deploy an Angular app to AWS S3 from scratch in less than five minutes Prerequisites
March 9, 2020
by Marouen Helali
· 31,558 Views · 6 Likes
article thumbnail
Defining Implementations of Services: Dependency Injection in Angular
I was working on a practical project using Angular 8, where I was creating a service and thinking more about how to implement SOLID principles. I decided to have an interface to define my service and a class to implement the logic. Everything was okay with that design, but a question came to my mind, "How can I implement dependency injection with my Angular component?" In this example, I am going to use an abstract class, Let's create an abstract class, named IGreetingsService. This will be used as an Interface with a greeting method. TypeScript x 1 export abstract class IGreetingsService { 2 constructor() { } 3 abstract greeting(): String; 4 } Now, let's create a class, GreetingsServiceImpl. This class implements the IGreetingsService abstract class. TypeScript xxxxxxxxxx 1 1 export class GreetingsServiceImpl implements IGreetingsService { 2 constructor() { } 3 greeting(): String{ 4 return "Pruebaa"; 5 }; 6 } At this point, we have a regular class to use as a service, but we need to add the annotation @Injectable. We have to put it at IGreetingsService. TypeScript x 10 1 @Injectable({ 2 providedIn: 'root', 3 useClass: GreetingsServiceImpl, 4 }) 5 export abstract class IGreetingsService { 6 7 constructor() { } 8 9 abstract greeting(): String; 10 } The magic is at the property useClass. This class is used by the Angular framework to know what concrete class has to use for dependency injection when you are using theIGreetingsService abstract class. So we are ready to use our service into an angular component. TypeScript xxxxxxxxxx 1 12 1 @Component({ 2 selector: 'my-app', 3 templateUrl: './app.component.html', 4 styleUrls: [ './app.component.css' ] 5 }) 6 export class AppComponent { 7 name: String; 8 constructor(private service: IGreetingsService ) { 9 this.name = this.service.greeting(); 10 } 11 12 } At the moment, to create an instance of the AppComponent, Angular automatically creates an instance of GreetingsServiceImpl , instead of IGreetingsService. (Remember IGreetingsService is an abstract class). This approach can help you in several situations; for example, think about a service using REST services to get some data, but now there is a new requirement, and you need to get the same data from session storage or local storage. You can create a new class implementing your abstract class and update the property useClass to refer to your new class. Another situation would be if you needed a different implementation on production environments and testing environments. You can find the complete source code here: https://stackblitz.com/edit/angular8-injectiondependency-interface. A final note, you can define a provider in the component definition annotation to inject a specific implementation of your service. TypeScript x 1 @Component({ 2 selector: 'my-app', 3 templateUrl: './app.component.html', 4 styleUrls: [ './app.component.css' ], 5 providers :[{ provide: IGreetingsService, useClass: GreetingsServiceImpl }] 6 }) Further Reading Angular: Everything You Need to Know [Tutorials]. About Dependency Injection.
March 9, 2020
by Javier Santos
· 9,579 Views · 4 Likes
  • Previous
  • ...
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×