Typescript Configuration

Bootstrapping a project in the terminal you can run mkdir typescript-sandbox cd typescript-sandbox npm init -y git init touch .gitignore This will create a folder for your project, change directory into it and intiallize it with a package.json and git repository. After doing so, I also added node_modules to the .gitignore file to prevent those... Continue Reading →

Exploring Angular v12 Part 8 – Conditional rendering

This post will describe two examples of how to conditionally render content within templates in Angular 12. The first example explains the if/else directive, whereas the second example details usage of switch directive (ngSwitch). Rendering conditionally with if/else logic This method is suitable when there is a small or finite number of cases to account... Continue Reading →

Exploring Angular v12 Part 6 – Piping

This post will go through some examples of how to pipe data, within templates in Angular 12. Piping is an in-built feature which allows you to transform information within templates, in a clean and maintainable fashion. This may include numbers, strings, json objects, etc. In-built pipes The following file has some examples of how to... Continue Reading →

Exploring Angular v12 Part 5 – Unit testing

This post will go through some examples of how I tested an angular component using the core testing library, karma and jasmine. Writing tests After generating a component, the test file would have been automatically created by the Angular CLI. It is denoted by .spec.ts . For my particular component, it looks something like this,... Continue Reading →

Exploring Angular v12 Part 2 – Routing

This post will go through how to navigate pages using Angular in-built router, example closely follows the official docs example. Docs I referenced are from here Creating two page components In this example, I want to create at least two pages. I started off by creating two new components, they will both represent a page... Continue Reading →

Setting up commitlint and husky with a new project

This guide will go though how to setup husky version 6+ with commitlint version 12+. Husky allows for running scripts throughout the lifecycle of git, whereas commitlint allows you to add rules to format your commits by convention. Earlier versions require setting up configuration through package.json, however with the latest version of husky this is... Continue Reading →

Website Built with WordPress.com.

Up ↑