Developer blog

Using orderBy to sort Date strings in AngularJS

Suppose you have an array or list that includes date strings, and you want to apply the AngularJS orderBy filter. This is usually fine for dates in the format YYYY-mm-dd as they end up sorted more or less correctly. However, other formats can give you a headache. The format dd-mm-YYYY doesn’t sort as nicely, neither does mm-dd-YYYY. This article provides two possible solutions for orderBy while keeping the data as a string.

ServiceNow: Creating a news ticker widget for Service Portal

This article describes how to create a simple horizontal scrolling marquee (news ticker) widget using CSS in the ServiceNow Service Portal. This solution implements the Pure CSS Ticker (Horizontal) into a widget for use in the Service Portal. The widget will display a text message scrolling from right to left and repeating infinitely. Create a new widget Navigate to Service Portal > Service Portal Configuration and select Widget Editor.

Using ng-repeat-start in AngularJS

You are probably familiar with the use of ng-repeat to repeat the DOM element it is attached to. One common use is rendering table columns using ng-repeat. The limitation of this approach is that ng-repeat will only repeat the element it is attached to, such as the <td> tag. As of AngularJS 1.2 you can define repeat start and end points using ng-repeat-start and ng-repeat-end. This means you can repeat a number of elements instead of just the first one.

ServiceNow: AngularJS UI Page template

AngularJS is used to build many of the default apps within ServiceNow and is a key technology in the Service Portal. You can also use ServiceNow to develop your own custom AngularJS applications that take advantage of the underlying ServiceNow platform. This article provides a basic AngularJS template for use in a UI Page. This can be used as a starting point for creating a basic AngularJS application in ServiceNow.

Creating custom directives in AngularJS

AngularJS directives are DOM elements with special markers that tell AngularJS to attach certain behaviour to the element. Commonly you’ll see these markers as an element tag (E) or element attribute (A). These special markers are also known as matching types. Let’s take a look at a couple of examples: Element (E) matching type: In this example, an element tag my-directive is used to reference a directive: <my-directive></mydirective> Attribute (A) matching type:

How to run Apache in a docker container

This article describes how to run the Apache HTTP Server in a docker container in Ubuntu 18. This is a useful approach when you don’t want to install Apache directly in Ubuntu. This article will also cover how to mount a local directory into the docker container, allowing you to create your website locally while having it served by Apache in a docker container. These steps assume you already have docker installed in Ubuntu.

Install Docker in Ubuntu 18

This article describes how to install Docker CE in Ubuntu 18.04 LTS. Follow the steps below to install Docker in Ubuntu 18 using the repository, or you can refer the official Docker Docs for other options. Docker is a popular container platform. Visit the official Docker website for more info: https://www.docker.com/ How to install Docker Launch a new terminal window

Install PHP in Ubuntu 18

This article is the third in a mini-series of quick reference guides for installing Apache, PHP, and MySQL in Ubuntu 18. In this article we will cover the installation of PHP 7.2 and the Apache PHP module. Lastly we’ll verify PHP works with Apache. My environment for these steps is Ubuntu 16 running on VirtualBox in Windows 10 x64. Previous articles Check out the previous articles where we installed Apache HTTP Server and MySQL.

Install MySQL in Ubuntu 18

This article is the second in a mini-series of quick reference guides for installing Apache, PHP, and MySQL in Ubuntu 18. In this article we will cover the installation of MySQL Server in Ubuntu 18, and take a quick look at using the mysql client. My environment for these steps is Ubuntu 18.04 LTS running in VirtualBox on Windows 10 x64. Previous articles Check out the previous article where we installed Apache HTTP Server.

Install Apache in Ubuntu 18

This article is the first in a mini-series of quick reference guides for installing Apache, PHP, and MySQL in Ubuntu 18. These steps are possibly the minumum required for getting a web development environment up and running, and can be used for local testing of your web development. This first article will cover the installation of the Apache HTTP Server. My environment for these steps is Ubuntu 18.04 LTS running on VirtualBox in Windows 10 x64.