My name is Carl. I am a software engineer and architect. I blog about C#, .NET, Javascript, AngularJS, nodejs, and more. Thanks for visiting!



Buy me a coffeeBuy me a coffee

Tags

Azure B2C authentication with API and SPA

In this post, I configure an Azure B2C tenant and show how to authenticate a user through a single page application to connect to endpoints in a custom API application. By the end, you will have a working demo of an authenticated user interacting with authorized API endpoints through a SPA using Azure B2C. The single page application contains a breakout-inspired game that tracks users' scores using a custom API. An Azure subscription is required but, at the time of this post, creating an azure B2C tenant is free up to a certain number of active users.

Read More...


Use Dropbox for Persistent Storage with an Angular Application

In this post, I create an Angular application that uses Dropbox for persistent storage. I start with creating a regular Angular app using the Angular CLI and then add Dropbox integration to it. At the end, you will have a working example of Dropbox integration with an Angular app.

Read More...


How To Create Directive Specific Styles In AngularJS

In this post, I show how to leverage css selectors to make styles specific to an AngularJS controller or directive. The technique seems obvious once it's pointed out but it's something I never thought of until recently. Hopefully this can also help others better organize css in their AngularJS applications.

Read More...


Create Fake Data Using Json Schema Faker

In this post I will look at how to create fake data using Json Schema Faker and faker.js. Json Schema Faker is a node package that uses fake data generators and a schema defined in JSON to create fake data. Any application that handles data in the JSON format can use this for testing, prototyping, or general development. I will cover how to create a json schema and how to generate mock data for it using Json Schema Faker. This tutorial assumes basic knowledge of javacsript, NodeJS, and NPM and that NodeJS and NPM are installed.

Read More...


AngularJS Route Resolve Failed Promise Example

In the previous post I looked at how the resolve property of an AngularJS route can be used to pass dependencies to a controller. In that example the resolve property in the route configuration called a service that returned a promise. The resolve property then passes the result of the promise to the controller when it is instantiated. The question that came up is what if there is an error and the promise is rejected instead of resolved? That's what I'll be answering in this post.

Read More...


AngularJS Route Resolve Example

The resolve property is attached to a route in AngularJS to provide a list of dependencies for the route. The data from this list is injected into the route controller and if any of the dependencies are promises, the promise will be resolved before the controller is instantiated. This helps keep the controller clean because any data the controller depends on can be injected into it instead of the controller retrieving that data itself. This post will go through an example of using the resolve property and show the differences between using a resolve property versus putting the fetch code in the controller directly.

Read More...


Using Javascript Promises for Application Logic in an AngularJS Service

The example in this post shows how the $q service can be used to harness the power of javascript promises to perform application logic in an AngularJS application. This can help keep application code organized and separate responsibilities among controllers and services.

Read More...



© 2026 Carl Layton Creative Commons License Disclaimer
An unhandled error has occurred. Reload 🗙