RxJs is a really powerful library for doing reactive programming and working with data. Like any powerful library though we run into issues that might make us scratch our head if we haven’t seen before.
Say for example have a method in a service or controller in Angular that needs to return some data from an inner or nested subscribe.
If we try and do it like this, the method will try and return a subscription to the observable when we’re trying to return an observable with real data.
There are a few different ways to fix this, but…
What seems like forever ago, I wrote about a simple and easy MVC pattern that can be used with Node and Express. As time went on, I have started to evolve the pattern to mimic patterns found in enterprise frameworks such as .NET Web API 2.
First a few disclaimers.
First, this really isn’t an MVC pattern because there is no view. It’s more of a MCS pattern, or Model > Controller > Store. That being said, we won’t be covering the Model portion of MCS, just controllers, and stores.
Second, focus on the pattern, not the code. It’s been…
As part of providing some API usage examples, I worked up an example that includes how to page through an Api using async/await. I won’t go to much into detail here since the pattern speaks for itself.
The code could be condensed and improved, but I left it verbose for clarity and its not really the point. For example, instead of doing:
let response = await reqUsers(token, offset)
We could refactor to this:
records.push.apply(records, await reqUsers(token, offset))
Without the use of Async/Await you would need a much clunkier pattern or recursion. …
This article is for anyone who has built an API in Node using Express and is interested in securing it based on the concept of Allowed Origins and CORS or Cross Origin Resource Sharing. You may have secured a good part of your application with token based authorization for an authenticated user or API key, but what about the parts of your application that rely on anonymous or semi-anonymous access? That’s where Allowed Origins come in.
When a consumer sends a request to the API, either through the browser, Postman or a program, the request will include a host in…
If you are reading this, you probably feel alone, angry, abandoned by our society. You, however, are not alone. I’m here to walk you through this journey of frustration. You have probably looked at dozens of GitHub and Stack Overflow issues, none providing you the oasis of a compiled binary.
Let’s see what we can do to help.
The error message you are probably seeing, or some variation of it (there are many:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
MSB8036: The Windows SDK version 8.1 was not found. …
This pattern still works and is effective, that being said I have an article that is in Alpha with a newer more complete pattern posted below
Now back to our regularly scheduled programming.
For some reason most examples of Node/Express MVC architecture are extremely over complicated, rely on third party packages, or are way to long and boring to follow.
All though this article is short and to the point, if you’re like me, you only really want an example that…
Sexy Input Styling Example with CSS
For the app I am currently making, I wanted to create transparent inputs with rounded corners and styled placeholders.
In researching how to do this, I found there was a surprisingly small set of nice examples for me too follow and very little information in general. Below is the look I was going for. Primarily, I wanted the background of the input transparent and rounded white borders. Additionally, I wanted the placeholder to standout and “fit” with the background and overall look.
How I made it (Gist)
The obvious thing to…
Developer at Knowledge Anywhere