Angular Error Explained: Expression Changed After It Has Been Checked Error

A colleague of mine encounters an error message while developing an Angular frontend app. The error message is like this: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value ‘null’, Current value: ‘true’. The scenario for this error is when he’s developing a back button feature from the second page to the first page,… Continue reading Angular Error Explained: Expression Changed After It Has Been Checked Error

Handle user close browser event with JavaScript

For some scenarios, you don’t want the user to close the browser and exit the journey. For example, if a user is filling in a form without saving or in the middle of payment transaction without complete, then you could prompt the user with confirmation dialog when the user clicks the close browser button. For… Continue reading Handle user close browser event with JavaScript

Setup MongoDB with Koa.js

I’m building a Koa.js server and need to connect to MongoDB to store and retrieve data. Here is how to do it with some simple steps: Step 1: Connect the database before Koa app initialised const initDB = require(‘./database’); initDB(); const app = new Koa(); Inside the database.js, import mongoose. You will need to npm… Continue reading Setup MongoDB with Koa.js

Setup npm proxy in a corporate network

It’s painful to work behind a corporate network and everything does not work out of the box. Simple command like npm install would not work and here is how to work through the proxy: Assuming you somehow get nodejs installed in your corporate laptop, open the .npmrc file which typical in the path for windows C:Users<your_user_id>.npmrc… Continue reading Setup npm proxy in a corporate network

Deploy Koa.js Application to AWS EC2 ubuntu instance

I am developing a Koa application, which is a new web framework designed by the team behind Express. Here is a step-by-step tutorial on how to deploy the koa.js application on your Amazon Web Service (AWS) ubuntu server. Firstly, launch the ubuntu instance on AWS. Then you need to change the security group. Otherwise if… Continue reading Deploy Koa.js Application to AWS EC2 ubuntu instance

What I learned from building large-scale application for overseas clients

The I.T. industry in China is a rapidly growing market. Over the last 1 year in Hong Kong, I’ve been lucky enough to work on an exciting project. I’ve also had the chance to learn something that’s never encountered before, making a major milestone for career. Like many other projects, it is better to have… Continue reading What I learned from building large-scale application for overseas clients

What I learned from building a large-scale application for overseas clients

The I.T. industry in China is a rapidly growing market. Over the last 1 year in Hong Kong, I’ve been lucky enough to work on an exciting project. I’ve also had the chance to learn something that’s never encountered before, making a major milestone for a career. Like many other projects, it is better to… Continue reading What I learned from building a large-scale application for overseas clients

How to use Webpack with React and Bootstrap

I was setting up a project today using Webpack, React and Bootstrap without jQuery. This supposed to be a straight forward task , but turns out I have spent a bit of time to figure it out. So I’m going to document the steps as shown below: Firstly, install all dependencies: npm install react react-dom bootstrap… Continue reading How to use Webpack with React and Bootstrap