Test Driven Development is a programming practice that has been preached and promoted by every developer community on the planet. And yet it's a routine that is largely neglected by a developer while learning a new framework. Writing unit tests from day one will help you to write better code, spot bugs with ease, and maintain a better development workflow.
Angular, being a full-fledged front-end development platform, has its own set of tools for testing. We will be using the following tools in this tutorial:
it('should have a defined component', () => { expect(component).toBeDefined(); });
TestBed
and ComponentFixtures
and helper functions such as async
and fakeAsync
are part of the @angular/core/testing
package. Getting acquainted with these utilities is necessary if you want to write tests that reveal how your components interact with their own template, services, and other components.We are not going to cover functional tests using Protractor in this tutorial. Protractor is a popular end-to-end test framework that interacts with the application's UI using an actual browser.
In this tutorial, we are more concerned about testing components and the component's logic. However, we will be writing a couple of tests that demonstrate basic UI interaction using the Jasmine framework.
The goal of this tutorial is to create the front-end for a Pastebin application in a test-driven development environment. In this tutorial, we will follow the popular TDD mantra, which is "red/green/refactor". We will write tests that initially fail (red) and then work on our application code to make them pass (green). We shall refactor our code when it starts to stink, meaning that it gets bloated and ugly.
We will be writing tests for components, their templates, services, and the Pastebin class. The image below illustrates the structure of our Pastebin application. The items that are grayed out will be discussed in the second part of the tutorial.
In the first part of the series, we will solely concentrate on setting up the testing environment and writing basic tests for components. Angular is a component-based framework; therefore, it is a good idea to spend some time getting acquainted with writing tests for components. In the second part of the series, we will write more complex tests for components, components with inputs, routed components, and services. By the end of the series, we will have a fully functioning Pastebin application that looks like this.
In this tutorial, you will learn how to:
The entire code for the tutorial is available on Github.
https://github.com/blizzerand/pastebin-angular
Clone the repo and feel free to check out the code if you are in doubt at any stage of this tutorial. Let's get started!
The developers at Angular have made it easy for us to set up our test environment. To get started, we need to install Angular first. I prefer using the Angular-CLI. It's an all-in-one solution that takes care of creating, generating, building and testing your Angular project.
ng new Pastebin
Here is the directory structure created by Angular-CLI.
Since our interests are inclined more towards the testing aspects in Angular, we need to look out for two types of files.
karma.conf.js is the configuration file for the Karma test runner and the only configuration file that we will need for writing unit tests in Angular. By default, Chrome is the default browser-launcher used by Karma to capture tests. We will create a custom launcher for running the headless Chrome and add it to the browsers
array.
/*karma.conf.js*/ browsers: ['Chrome','ChromeNoSandboxHeadless'], customLaunchers: { ChromeNoSandboxHeadless: { base: 'Chrome', flags: [ '--no-sandbox', // See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md '--headless', '--disable-gpu', // Without a remote debugging port, Google Chrome exits immediately. ' --remote-debugging-port=9222', ], }, },
The other type of file that we need to look out for is anything that ends with .spec.ts
. By convention, the tests written in Jasmine are called specs. All the test specs should be located inside the application's src/app/
directory because that's where Karma looks for the test specs. If you create a new component or a service, it is important that you place your test specs inside the same directory that the code for the component or service resides in.
The ng new
command has created an app.component.spec.ts
file for our app.component.ts
. Feel free to open it up and have a good look at the Jasmine tests in Angular. Even if the code doesn't make any sense, that is fine. We will keep AppComponent as it is for now and use it to host the routes at some later point in the tutorial.
We need a Pastebin class to model our Pastebin inside the components and tests. You can create one using the Angular-CLI.
ng generate class Pastebin
Add the following logic to Pastebin.ts:
export class Pastebin { id: number; title: string; language: string; paste: string; constructor(values: Object = {}) { Object.assign(this, values); } } export const Languages = ["Ruby","Java", "JavaScript", "C", "Cpp"];
We have defined a Pastebin class, and each instance of this class will have the following properties:
id
title
language
paste
Create another file called pastebin.spec.ts
for the test suite.
/* pastebin.spec.ts */ //import the Pastebin class import { Pastebin } from './pastebin'; describe('Pastebin', () => { it('should create an instance of Pastebin',() => { expect(new Pastebin()).toBeTruthy(); }); })
The test suite starts with a describe
block, which is a global Jasmine function that accepts two parameters. The first parameter is the title of the test suite, and the second one is its actual implementation. The specs are defined using an it
function that takes two parameters, similar to that of the describe
block.
Multiple specs (it
blocks) can be nested inside a test suite (describe
block). However, ensure that the test suite titles are named in such a way that they are unambiguous and more readable because they are meant to serve as a documentation for the reader.
Expectations, implemented using the expect
function, are used by Jasmine to determine whether a spec should pass or fail. The expect
function takes a parameter which is known as the actual value. It is then chained with another function that takes the expected value. These functions are called matcher functions, and we will be using the matcher functions like toBeTruthy()
, toBeDefined()
, toBe()
, and toContain()
a lot in this tutorial.
expect(new Pastebin()).toBeTruthy();
So with this code, we've created a new instance of the Pastebin class and expect it to be true. Let's add another spec to confirm that the Pastebin model works as intended.
it('should accept values', () => { let pastebin = new Pastebin(); pastebin = { id: 111, title: "Hello world", language: "Ruby", paste: 'print "Hello"', } expect(pastebin.id).toEqual(111); expect(pastebin.language).toEqual("Ruby"); expect(pastebin.paste).toEqual('print "Hello"'); });
We've instantiated the Pastebin class and added a few expectations to our test spec. Run ng test
to verify that all the tests are green.
Generate a service using the below command.
ng generate service pastebin
PastebinService
will host the logic for sending HTTP requests to the server; however, we don't have a server API for the application we are building. Therefore, we are going to simulate the server communication using a module known as InMemoryWebApiModule.
Install angular-in-memory-web-api
via npm:
npm install angular-in-memory-web-api --save
Update AppModule with this version.
/* app.module.ts */ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; //Components import { AppComponent } from './app.component'; //Service for Pastebin import { PastebinService } from "./pastebin.service"; //Modules used in this tutorial import { HttpModule } from '@angular/http'; //In memory Web api to simulate an http server import { InMemoryWebApiModule } from 'angular-in-memory-web-api'; import { InMemoryDataService } from './in-memory-data.service'; @NgModule({ declarations: [ AppComponent, ], imports: [ BrowserModule, HttpModule, InMemoryWebApiModule.forRoot(InMemoryDataService), ], providers: [PastebinService], bootstrap: [AppComponent] }) export class AppModule { }
Create an InMemoryDataService
that implements InMemoryDbService
.
/*in-memory-data.service.ts*/ import { InMemoryDbService } from 'angular-in-memory-web-api'; import { Pastebin } from './pastebin'; export class InMemoryDataService implements InMemoryDbService { createDb() { const pastebin:Pastebin[] = [ { id: 0, title: "Hello world Ruby", language: "Ruby", paste: 'puts "Hello World"' }, {id: 1, title: "Hello world C", language: "C", paste: 'printf("Hello world");'}, {id: 2, title: "Hello world CPP", language: "C++", paste: 'cout<<"Hello world";'}, {id: 3, title: "Hello world Javascript", language: "JavaScript", paste: 'console.log("Hello world")'} ]; return {pastebin}; } }
Here, pastebin
is an array of sample pastes that will be returned or updated when we perform an HTTP action like http.get
or http.post
.
/*pastebin.service.ts */ import { Injectable } from '@angular/core'; import { Pastebin } from './pastebin'; import { Http, Headers } from '@angular/http'; import 'rxjs/add/operator/toPromise'; @Injectable() export class PastebinService { // The project uses InMemoryWebApi to handle the Server API. // Here "api/pastebin" simulates a Server API url private pastebinUrl = "api/pastebin"; private headers = new Headers({'Content-Type': "application/json"}); constructor(private http: Http) { } // getPastebin() performs http.get() and returns a promise public getPastebin():Promise<any> { return this.http.get(this.pastebinUrl) .toPromise() .then(response => response.json().data) .catch(this.handleError); } private handleError(error: any): Promise<any> { console.error('An error occurred', error); return Promise.reject(error.message || error); } }
The getPastebin()
method makes an HTTP.get request and returns a promise that resolves to an array of Pastebin objects returned by the server.
If you get a No provider for HTTP error while running a spec, you need to import the HTTPModule to the concerned spec file.
Components are the most basic building block of an UI in an Angular application. An Angular application is a tree of Angular components.
— Angular Documentation
As highlighted earlier in the Overview section, we will be working on two components in this tutorial: PastebinComponent
and AddPasteComponent
. The Pastebin component consists of a table structure that lists all the paste retrieved from the server. The AddPaste component holds the logic for creation of new pastes.
Go ahead and generate the components using Angular-CLI.
ng g component --spec=false Pastebin
The --spec=false
option tells the Angular-CLI not to create a spec file. This is because we want to write unit tests for components from scratch. Create a pastebin.component.spec.ts
file inside the pastebin-component folder.
Here's the code for pastebin.component.spec.ts
.
import { TestBed, ComponentFixture, async } from '@angular/core/testing'; import { DebugElement } from '@angular/core'; import { PastebinComponent } from './pastebin.component'; import { By } from '@angular/platform-browser'; import { Pastebin, Languages } from '../pastebin'; //Modules used for testing import { HttpModule } from '@angular/http'; describe('PastebinComponent', () => { //Typescript declarations. let comp: PastebinComponent; let fixture: ComponentFixture<PastebinComponent>; let de: DebugElement; let element: HTMLElement; let mockPaste: Pastebin[]; // beforeEach is called once before every `it` block in a test. // Use this to configure to the component, inject services etc. beforeEach(()=> { TestBed.configureTestingModule({ declarations: [ PastebinComponent ], // declare the test component imports: [ HttpModule], }); fixture = TestBed.createComponent(PastebinComponent); comp = fixture.componentInstance; de = fixture.debugElement.query(By.css('.pastebin')); element = de.nativeElement; }); })
There's a lot going on here. Let's break it up and take one piece at a time. Within the describe
block, we've declared some variables, and then we've used a beforeEach
function. beforeEach()
is a global function provided by Jasmine and, as the name suggests, it gets invoked once before every spec in the describe
block in which it is called.
TestBed.configureTestingModule({ declarations: [ PastebinComponent ], // declare the test component imports: [ HttpModule], });
TestBed
class is a part of the Angular testing utilities, and it creates a testing module similar to that of the @NgModule
class. Furthermore, you can configure TestBed
using the configureTestingModule
method. For instance, you can create a test environment for your project that emulates the actual Angular application, and you can then pull a component from your application module and re-attach it to this test module.
fixture = TestBed.createComponent(PastebinComponent); comp = fixture.componentInstance; de = fixture.debugElement.query(By.css('div')); element = de.nativeElement;
From the Angular documentation:
ThecreateComponent
method returns aComponentFixture
, a handle on the test environment surrounding the created component. The fixture provides access to the component instance itself and to theDebugElement
, which is a handle on the component's DOM element.
As mentioned above, we've created a fixture of the PastebinComponent
and then used that fixture to create an instance of the component. We can now access the component's properties and methods inside our tests by calling comp.property_name
. Since the fixture also provides access to the debugElement
, we can now query the DOM elements and selectors.
There is an issue with our code that we haven't yet thought of. Our component has an external template and a CSS file. Fetching and reading them from the file system is an asynchronous activity, unlike the rest of the code, which is all synchronous.
Angular offers you a function called async()
that takes care of all the asynchronous stuff. What async does is keep track of all the asynchronous tasks inside it, while hiding the complexity of asynchronous execution from us. So we will now have two beforeEach functions, an asynchronous beforeEach()
and a synchronous beforeEach()
.
/* pastebin.component.spec.ts */ // beforeEach is called once before every `it` block in a test. // Use this to configure to the component, inject services etc. beforeEach(async(() => { //async before is used for compiling external templates which is any async activity TestBed.configureTestingModule({ declarations: [ PastebinComponent ], // declare the test component imports: [ HttpModule], }) .compileComponents(); // compile template and css })); beforeEach(()=> { //And here is the synchronous async function fixture = TestBed.createComponent(PastebinComponent); comp = fixture.componentInstance; de = fixture.debugElement.query(By.css('.pastebin')); element = de.nativeElement; });
We haven't written any test specs yet. However, it's a good idea to create an outline of the specs beforehand. The image below depicts a rough design of the Pastebin component.
We need to write tests with the following expectations.
pastebinService
is injected into the component, and its methods are accessible.onInit()
is called.The first three tests are easy to implement.
it('should have a Component',()=> { expect(comp).toBeTruthy(); }); it('should have a title', () => { comp.title = 'Pastebin Application'; fixture.detectChanges(); expect(element.textContent).toContain(comp.title); }) it('should have a table to display the pastes', () => { expect(element.innerHTML).toContain("thead"); expect(element.innerHTML).toContain("tbody"); })
In a testing environment, Angular doesn't automatically bind the component's properties with the template elements. You have to explicitly call fixture.detectChanges()
every time you want to bind a component property with the template. Running the test should give you an error because we haven't yet declared the title property inside our component.
title: string = "Pastebin Application";
Don't forget to update the template with a basic table structure.
<div class = "pastebin"> <h2> {{title}}</h2> <table id="table" class="table table-hover table-striped"> <thead> <tr> <th> id </th> <th> Title </th> <th> Language </th> <th> Code </th> </tr> </thead> <tbody> </tbody> </table> </div>
As for the rest of the cases, we need to inject the Pastebinservice
and write tests that deal with component-service interaction. A real service might make calls to a remote server, and injecting it in its raw form will be a laborious and challenging task.
Instead, we should write tests that focus on whether the component interacts with the service as expected. We shall add specs that spy on the pastebinService
and its getPastebin()
method.
First, import the PastebinService
into our test suite.
import { PastebinService } from '../pastebin.service';
Next, add it to the providers
array inside TestBed.configureTestingModule()
.
TestBed.configureTestingModule({ declarations:[ CreateSnippetComponent], providers: [ PastebinService ], });
The code below creates a Jasmine spy that is designed to track all calls to the getPastebin()
method and return a promise that immediately resolves to mockPaste
.
//The real PastebinService is injected into the component let pastebinService = fixture.debugElement.injector.get(PastebinService); mockPaste = [ { id:1, title: "Hello world", language: "Ruby", paste: "puts 'Hello'" }]; spy = spyOn(pastebinService, 'getPastebin') .and.returnValue(Promise.resolve(mockPaste));
The spy isn't concerned about the implementation details of the real service, but instead, bypasses any call to the actual getPastebin()
method. Moreover, all the remote calls buried inside getPastebin()
are ignored by our tests. We will be writing isolated unit-tests for Angular services in the second part of the tutorial.
Add the following tests to pastebin.component.spec.ts
.
it('should not show the pastebin before OnInit', () => { this.tbody = element.querySelector("tbody"); //Try this without the 'replace(\s\s+/g,'')' method and see what happens expect(this.tbody.innerText.replace(/\s\s+/g, '')).toBe("", "tbody should be empty"); expect(spy.calls.any()).toBe(false, "Spy shouldn't be yet called"); }); it('should still not show pastebin after component initialized', () => { fixture.detectChanges(); // getPastebin service is async, but the test is not. expect(this.tbody.innerText.replace(/\s\s+/g, '')).toBe("", 'tbody should still be empty'); expect(spy.calls.any()).toBe(true, 'getPastebin should be called'); }); it('should show the pastebin after getPastebin promise resolves', async() => { fixture.detectChanges(); fixture.whenStable().then( () => { fixture.detectChanges(); expect(comp.pastebin).toEqual(jasmine.objectContaining(mockPaste)); expect(element.innerText.replace(/\s\s+/g, ' ')).toContain(mockPaste[0].title); }); })
The first two tests are synchronous tests. The first spec checks whether the innerText
of the div
element stays empty as long as the component isn't initialized. The second argument to Jasmine's matcher function is optional and is displayed when the test fails. This is helpful when you have multiple expect statements inside a spec.
In the second spec, the component is initialized (because fixture.detectChanges()
is called), and the spy is also expected to get invoked, but the template should not be updated. Even though the spy returns a resolved promise, the mockPaste
isn't available yet. It shouldn't be available unless the test is an asynchronous test.
The third test uses an async()
function discussed earlier to run the test in an async test zone. async()
is used to make a synchronous test asynchronous. fixture.whenStable()
is called when all pending asynchronous activities are complemented, and then a second round of fixture.detectChanges()
is called to update the DOM with the new values. The expectation in the final test ensures that our DOM is updated with the mockPaste
values.
To get the tests to pass, we need to update our pastebin.component.ts
with the following code.
/*pastebin.component.ts*/ import { Component, OnInit } from '@angular/core'; import { Pastebin } from '../pastebin'; import { PastebinService } from '../pastebin.service'; @Component({ selector: 'app-pastebin', templateUrl: './pastebin.component.html', styleUrls: ['./pastebin.component.css'] }) export class PastebinComponent implements OnInit { title: string = "Pastebin Application"; pastebin: any = []; constructor(public pastebinServ: PastebinService) { } //loadPastebin() is called on init ngOnInit() { this.loadPastebin(); } public loadPastebin() { //invokes pastebin service's getPastebin() method and stores the response in `pastebin` property this.pastebinServ.getPastebin().then(pastebin => this.pastebin = pastebin); } }
The template also needs to be updated.
<!--- pastebin.component.html --> <div class = "pastebin"> <h2> {{title}}</h2> <table id="table" class="table table-hover table-striped"> <thead> <tr> <th> id </th> <th> Title </th> <th> Language </th> <th> Code </th> </tr> </thead> <tbody> <tr *ngFor="let paste of pastebin"> <td> {{paste.id}} </td> <td> {{paste.title}} </td> <td> {{paste.language}} </td> <td> View code </td> </tr> </tbody> <!--- <app-add-paste (addPasteSuccess)= 'onAddPaste($event)'> </app-add-paste> --> </table> </div>
Generate an AddPaste component using Angular-CLI. The image below depicts the design of the AddPaste component.
The component's logic should pass the following specs.
showModal
property to true
. (showModal
is a boolean property that turns true when the modal is displayed and false when the modal is closed.)addPaste()
method.showModal
property to false
.We've worked out the first three tests for you. See if you can make the tests pass on your own.
describe('AddPasteComponent', () => { let component: AddPasteComponent; let fixture: ComponentFixture<AddPasteComponent>; let de: DebugElement; let element: HTMLElement; let spy: jasmine.Spy; let pastebinService: PastebinService; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AddPasteComponent ], imports: [ HttpModule, FormsModule ], providers: [ PastebinService ], }) .compileComponents(); })); beforeEach(() => { //initialization fixture = TestBed.createComponent(AddPasteComponent); pastebinService = fixture.debugElement.injector.get(PastebinService); component = fixture.componentInstance; de = fixture.debugElement.query(By.css('.add-paste')); element = de.nativeElement; spy = spyOn(pastebinService, 'addPaste').and.callThrough(); //ask fixture to detect changes fixture.detectChanges(); }); it('should be created', () => { expect(component).toBeTruthy(); }); it('should display the `create Paste` button', () => { //There should a create button in the template expect(element.innerText).toContain("create Paste"); }); it('should not display the modal unless the button is clicked', () => { //source-model is an id for the modal. It shouldn't show up unless create button is clicked expect(element.innerHTML).not.toContain("source-modal"); }) it("should display the modal when 'create Paste' is clicked", () => { let createPasteButton = fixture.debugElement.query(By.css("button")); //triggerEventHandler simulates a click event on the button object createPasteButton.triggerEventHandler("click",null); fixture.detectChanges(); expect(element.innerHTML).toContain("source-modal"); expect(component.showModal).toBeTruthy("showModal should be true"); }) })
DebugElement.triggerEventHandler()
is the only thing new here. It is used to trigger a click event on the button element on which it is called. The second parameter is the event object, and we've left it empty since the component's click()
doesn't expect one.
That's it for the day. In this first article, we learned:
In the next tutorial, we'll create new components, write more tests components with inputs and outputs, services, and routes. Stay tuned for the second part of the series. Share your thoughts through the comments.
The Best Small Business Web Designs by DesignRush
/Create Modern Vue Apps Using Create-Vue and Vite
/Pros and Cons of Using WordPress
/How to Fix the “There Has Been a Critical Error in Your Website” Error in WordPress
/How To Fix The “There Has Been A Critical Error in Your Website” Error in WordPress
/How to Create a Privacy Policy Page in WordPress
/How Long Does It Take to Learn JavaScript?
/The Best Way to Deep Copy an Object in JavaScript
/Adding and Removing Elements From Arrays in JavaScript
/Create a JavaScript AJAX Post Request: With and Without jQuery
/5 Real-Life Uses for the JavaScript reduce() Method
/How to Enable or Disable a Button With JavaScript: jQuery vs. Vanilla
/How to Enable or Disable a Button With JavaScript: jQuery vs Vanilla
/Confirm Yes or No With JavaScript
/How to Change the URL in JavaScript: Redirecting
/15+ Best WordPress Twitter Widgets
/27 Best Tab and Accordion Widget Plugins for WordPress (Free & Premium)
/21 Best Tab and Accordion Widget Plugins for WordPress (Free & Premium)
/30 HTML Best Practices for Beginners
/31 Best WordPress Calendar Plugins and Widgets (With 5 Free Plugins)
/25 Ridiculously Impressive HTML5 Canvas Experiments
/How to Implement Email Verification for New Members
/How to Create a Simple Web-Based Chat Application
/30 Popular WordPress User Interface Elements
/Top 18 Best Practices for Writing Super Readable Code
/Best Affiliate WooCommerce Plugins Compared
/18 Best WordPress Star Rating Plugins
/10+ Best WordPress Twitter Widgets
/20+ Best WordPress Booking and Reservation Plugins
/Working With Tables in React: Part Two
/Best CSS Animations and Effects on CodeCanyon
/30 CSS Best Practices for Beginners
/How to Create a Custom WordPress Plugin From Scratch
/10 Best Responsive HTML5 Sliders for Images and Text… and 3 Free Options
/16 Best Tab and Accordion Widget Plugins for WordPress
/18 Best WordPress Membership Plugins and 5 Free Plugins
/25 Best WooCommerce Plugins for Products, Pricing, Payments and More
/10 Best WordPress Twitter Widgets
1 /12 Best Contact Form PHP Scripts for 2020
/20 Popular WordPress User Interface Elements
/10 Best WordPress Star Rating Plugins
/12 Best CSS Animations on CodeCanyon
/12 Best WordPress Booking and Reservation Plugins
/12 Elegant CSS Pricing Tables for Your Latest Web Project
/24 Best WordPress Form Plugins for 2020
/14 Best PHP Event Calendar and Booking Scripts
/Create a Blog for Each Category or Department in Your WooCommerce Store
/8 Best WordPress Booking and Reservation Plugins
/Best Exit Popups for WordPress Compared
/Best Exit Popups for WordPress Compared
/11 Best Tab & Accordion WordPress Widgets & Plugins
/12 Best Tab & Accordion WordPress Widgets & Plugins
1 /New Course: Practical React Fundamentals
/Preview Our New Course on Angular Material
/Build Your Own CAPTCHA and Contact Form in PHP
/Object-Oriented PHP With Classes and Objects
/Best Practices for ARIA Implementation
/Accessible Apps: Barriers to Access and Getting Started With Accessibility
/Dramatically Speed Up Your React Front-End App Using Lazy Loading
/15 Best Modern JavaScript Admin Templates for React, Angular, and Vue.js
/15 Best Modern JavaScript Admin Templates for React, Angular and Vue.js
/19 Best JavaScript Admin Templates for React, Angular, and Vue.js
/New Course: Build an App With JavaScript and the MEAN Stack
/Hands-on With ARIA: Accessibility Recipes for Web Apps
/10 Best WordPress Facebook Widgets
13 /Hands-on With ARIA: Accessibility for eCommerce
/New eBooks Available for Subscribers
/Hands-on With ARIA: Homepage Elements and Standard Navigation
/Site Accessibility: Getting Started With ARIA
/How Secure Are Your JavaScript Open-Source Dependencies?
/New Course: Secure Your WordPress Site With SSL
/Testing Components in React Using Jest and Enzyme
/Testing Components in React Using Jest: The Basics
/15 Best PHP Event Calendar and Booking Scripts
/Create Interactive Gradient Animations Using Granim.js
/How to Build Complex, Large-Scale Vue.js Apps With Vuex
1 /Examples of Dependency Injection in PHP With Symfony Components
/Set Up Routing in PHP Applications Using the Symfony Routing Component
1 /A Beginner’s Guide to Regular Expressions in JavaScript
/Introduction to Popmotion: Custom Animation Scrubber
/Introduction to Popmotion: Pointers and Physics
/New Course: Connect to a Database With Laravel’s Eloquent ORM
/How to Create a Custom Settings Panel in WooCommerce
/Building the DOM faster: speculative parsing, async, defer and preload
1 /20 Useful PHP Scripts Available on CodeCanyon
3 /How to Find and Fix Poor Page Load Times With Raygun
/Introduction to the Stimulus Framework
/Single-Page React Applications With the React-Router and React-Transition-Group Modules
12 Best Contact Form PHP Scripts
1 /Getting Started With the Mojs Animation Library: The ShapeSwirl and Stagger Modules
/Getting Started With the Mojs Animation Library: The Shape Module
/Getting Started With the Mojs Animation Library: The HTML Module
/Project Management Considerations for Your WordPress Project
/8 Things That Make Jest the Best React Testing Framework
/Creating an Image Editor Using CamanJS: Layers, Blend Modes, and Events
/New Short Course: Code a Front-End App With GraphQL and React
/Creating an Image Editor Using CamanJS: Applying Basic Filters
/Creating an Image Editor Using CamanJS: Creating Custom Filters and Blend Modes
/Modern Web Scraping With BeautifulSoup and Selenium
/Challenge: Create a To-Do List in React
1 /Deploy PHP Web Applications Using Laravel Forge
/Getting Started With the Mojs Animation Library: The Burst Module
/10 Things Men Can Do to Support Women in Tech
/A Gentle Introduction to Higher-Order Components in React: Best Practices
/Challenge: Build a React Component
/A Gentle Introduction to HOC in React: Learn by Example
/A Gentle Introduction to Higher-Order Components in React
/Creating Pretty Popup Messages Using SweetAlert2
/Creating Stylish and Responsive Progress Bars Using ProgressBar.js
/18 Best Contact Form PHP Scripts for 2022
/How to Make a Real-Time Sports Application Using Node.js
/Creating a Blogging App Using Angular & MongoDB: Delete Post
/Set Up an OAuth2 Server Using Passport in Laravel
/Creating a Blogging App Using Angular & MongoDB: Edit Post
/Creating a Blogging App Using Angular & MongoDB: Add Post
/Introduction to Mocking in Python
/Creating a Blogging App Using Angular & MongoDB: Show Post
/Creating a Blogging App Using Angular & MongoDB: Home
/Creating a Blogging App Using Angular & MongoDB: Login
/Creating Your First Angular App: Implement Routing
/Persisted WordPress Admin Notices: Part 4
/Creating Your First Angular App: Components, Part 2
/Persisted WordPress Admin Notices: Part 3
/Creating Your First Angular App: Components, Part 1
/How Laravel Broadcasting Works
/Persisted WordPress Admin Notices: Part 2
/Create Your First Angular App: Storing and Accessing Data
/Persisted WordPress Admin Notices: Part 1
/Error and Performance Monitoring for Web & Mobile Apps Using Raygun
/Using Luxon for Date and Time in JavaScript
7 /How to Create an Audio Oscillator With the Web Audio API
/How to Cache Using Redis in Django Applications
/20 Essential WordPress Utilities to Manage Your Site
/Introduction to API Calls With React and Axios
/Beginner’s Guide to Angular 4: HTTP
/Rapid Web Deployment for Laravel With GitHub, Linode, and RunCloud.io
/Beginners Guide to Angular 4: Routing
/Beginner’s Guide to Angular 4: Services
/Beginner’s Guide to Angular 4: Components
/Creating a Drop-Down Menu for Mobile Pages
/Introduction to Forms in Angular 4: Writing Custom Form Validators
/10 Best WordPress Booking & Reservation Plugins
/Getting Started With Redux: Connecting Redux With React
/Getting Started With Redux: Learn by Example
/Getting Started With Redux: Why Redux?
/Understanding Recursion With JavaScript
/How to Auto Update WordPress Salts
/How to Download Files in Python
/Eloquent Mutators and Accessors in Laravel
1 /10 Best HTML5 Sliders for Images and Text
/Site Authentication in Node.js: User Signup
/Creating a Task Manager App Using Ionic: Part 2
/Creating a Task Manager App Using Ionic: Part 1
/Introduction to Forms in Angular 4: Reactive Forms
/Introduction to Forms in Angular 4: Template-Driven Forms
/24 Essential WordPress Utilities to Manage Your Site
/25 Essential WordPress Utilities to Manage Your Site
/Get Rid of Bugs Quickly Using BugReplay
1 /Manipulating HTML5 Canvas Using Konva: Part 1, Getting Started
/10 Must-See Easy Digital Downloads Extensions for Your WordPress Site
/22 Best WordPress Booking and Reservation Plugins
/Understanding ExpressJS Routing
/15 Best WordPress Star Rating Plugins
/Creating Your First Angular App: Basics
/Inheritance and Extending Objects With JavaScript
/Introduction to the CSS Grid Layout With Examples
1Performant Animations Using KUTE.js: Part 5, Easing Functions and Attributes
Performant Animations Using KUTE.js: Part 4, Animating Text
/Performant Animations Using KUTE.js: Part 3, Animating SVG
/New Course: Code a Quiz App With Vue.js
/Performant Animations Using KUTE.js: Part 2, Animating CSS Properties
Performant Animations Using KUTE.js: Part 1, Getting Started
/10 Best Responsive HTML5 Sliders for Images and Text (Plus 3 Free Options)
/Single-Page Applications With ngRoute and ngAnimate in AngularJS
/Deferring Tasks in Laravel Using Queues
/Site Authentication in Node.js: User Signup and Login
/Working With Tables in React, Part Two
/Working With Tables in React, Part One
/How to Set Up a Scalable, E-Commerce-Ready WordPress Site Using ClusterCS
/New Course on WordPress Conditional Tags
/TypeScript for Beginners, Part 5: Generics
/Building With Vue.js 2 and Firebase
6 /Best Unique Bootstrap JavaScript Plugins
/Essential JavaScript Libraries and Frameworks You Should Know About
/Vue.js Crash Course: Create a Simple Blog Using Vue.js
/Build a React App With a Laravel RESTful Back End: Part 1, Laravel 5.5 API
/API Authentication With Node.js
/Beginner’s Guide to Angular: Routing
/Beginners Guide to Angular: Routing
/Beginner’s Guide to Angular: Services
/Beginner’s Guide to Angular: Components
/How to Create a Custom Authentication Guard in Laravel
/Learn Computer Science With JavaScript: Part 3, Loops
/Build Web Applications Using Node.js
/Learn Computer Science With JavaScript: Part 4, Functions
/Learn Computer Science With JavaScript: Part 2, Conditionals
/Create Interactive Charts Using Plotly.js, Part 5: Pie and Gauge Charts
/Create Interactive Charts Using Plotly.js, Part 4: Bubble and Dot Charts
Create Interactive Charts Using Plotly.js, Part 3: Bar Charts
/Awesome JavaScript Libraries and Frameworks You Should Know About
/Create Interactive Charts Using Plotly.js, Part 2: Line Charts
/Bulk Import a CSV File Into MongoDB Using Mongoose With Node.js
/Build a To-Do API With Node, Express, and MongoDB
/Getting Started With End-to-End Testing in Angular Using Protractor
/TypeScript for Beginners, Part 4: Classes
/Object-Oriented Programming With JavaScript
/10 Best Affiliate WooCommerce Plugins Compared
/Stateful vs. Stateless Functional Components in React
/Make Your JavaScript Code Robust With Flow
/Build a To-Do API With Node and Restify
/Testing Components in Angular Using Jasmine: Part 2, Services
/Testing Components in Angular Using Jasmine: Part 1
/Creating a Blogging App Using React, Part 6: Tags
/React Crash Course for Beginners, Part 3
/React Crash Course for Beginners, Part 2
/React Crash Course for Beginners, Part 1
/Set Up a React Environment, Part 4
1 /Set Up a React Environment, Part 3
/New Course: Get Started With Phoenix
/Set Up a React Environment, Part 2
/Set Up a React Environment, Part 1
/Command Line Basics and Useful Tricks With the Terminal
/How to Create a Real-Time Feed Using Phoenix and React
/Build a React App With a Laravel Back End: Part 2, React
/Build a React App With a Laravel RESTful Back End: Part 1, Laravel 9 API
/Creating a Blogging App Using React, Part 5: Profile Page
/Pagination in CodeIgniter: The Complete Guide
/JavaScript-Based Animations Using Anime.js, Part 4: Callbacks, Easings, and SVG
/JavaScript-Based Animations Using Anime.js, Part 3: Values, Timeline, and Playback
/Learn to Code With JavaScript: Part 1, The Basics
/10 Elegant CSS Pricing Tables for Your Latest Web Project
/Getting Started With the Flux Architecture in React
/Getting Started With Matter.js: The Composites and Composite Modules
Getting Started With Matter.js: The Engine and World Modules
/10 More Popular HTML5 Projects for You to Use and Study
/Understand the Basics of Laravel Middleware
/Iterating Fast With Django & Heroku
/Creating a Blogging App Using React, Part 4: Update & Delete Posts
/Creating a jQuery Plugin for Long Shadow Design
/How to Register & Use Laravel Service Providers
2 /Unit Testing in React: Shallow vs. Static Testing
/Creating a Blogging App Using React, Part 3: Add & Display Post
/Creating a Blogging App Using React, Part 2: User Sign-Up
20 /Creating a Blogging App Using React, Part 1: User Sign-In
/Creating a Grocery List Manager Using Angular, Part 2: Managing Items
/9 Elegant CSS Pricing Tables for Your Latest Web Project
/Dynamic Page Templates in WordPress, Part 3
/Angular vs. React: 7 Key Features Compared
/Creating a Grocery List Manager Using Angular, Part 1: Add & Display Items
New eBooks Available for Subscribers in June 2017
/Create Interactive Charts Using Plotly.js, Part 1: Getting Started
/The 5 Best IDEs for WordPress Development (And Why)
/33 Popular WordPress User Interface Elements
/New Course: How to Hack Your Own App
/How to Install Yii on Windows or a Mac
/What Is a JavaScript Operator?
/How to Register and Use Laravel Service Providers
/
waly Good blog post. I absolutely love this…