Rick Strahl's Web Log
Wind, waves, code and everything in between...
Ad-free experience sponsored by:
- the market leader of .NET and Java APIs for file formats – natively work with DOCX, XLSX, PPT, PDF, images and more
WebLog Posts in Category Angular
January, 2020 (1)
December, 2019 (2)
November, 2019 (3)
October, 2019 (1)
September, 2019 (5)
August, 2019 (2)
June, 2019 (1)
May, 2019 (2)
April, 2019 (5)
March, 2019 (1)
February, 2019 (4)
January, 2019 (3)
December, 2018 (2)
November, 2018 (3)
October, 2018 (2)
September, 2018 (1)
August, 2018 (2)
July, 2018 (1)
June, 2018 (3)
May, 2018 (2)
April, 2018 (2)
March, 2018 (1)
February, 2018 (1)
January, 2018 (1)
Visual Studio (51)
ASP.NET Core (42)
Web Services (19)
Web Api (16)
.NET Core (15)
Sql Server (9)
Microsoft AJAX (8)
Web Connection (7)
West Wind Ajax Toolkit (7)
Entity Framework (6)
Internet Explorer (6)
Html Help Builder (5)
Live Writer (5)
Source Control (4)
Markdown Monster (4)
Help Builder (3)
Web Browser Control (3)
Software Development (3)
Visual Studio Code (2)
ASP.NET vNext (2)
.NET Standard (2)
Visual Studio (1)
ASP.NET Markdown (1)
Control Development (1)
Credit Card Processing (1)
Dynamic Types (1)
VS Code (1)
Web Deployment Projects (1)
Web Design (1)
Web Assembly (1)
Creating Angular Synchronous and Asynchronous Validators for Template Validation
November 18, 2019 - Maui, Hawaii
Validations are a key feature of any business application and in Angular there's an infrastructure for building validators built in. A number of existing validators provide the basics but if you have custom business logic to process for validation you'll need to create custom Validators. In this post I describe how to create both sync and asycn Angular Validators for use in declarative forms.
Using the ng-BootStrap TypeAhead Control with Dynamic Data
April 08, 2019 - Maui, Hawaii
I recently swapped my Auto complete logic in an application to use ng-bootstrap's nice and relatively easy to use TypeAhead control and I ran into a small snag trying to figure out how to bind dynamic data retrieved from the server. The examples show local data binding but fail to show how to load and update the control with remote data. In this post I show how the control works both in sync and async mode and point out the simple solution that eluded my via the Observable switchMap operator.
Creating a custom HttpInterceptor to handle 'withCredentials' in Angular 6+
April 07, 2019 - Maui, Hawaii
Client HTTP requests often need to set a few common settings and you don't want to set them on every request. To make this process easier Angular provides an HttpInterceptor class that you can subclass and add custom behavior to for each HTTP request that is sent through the HttpClient. Here's a quick review on how to do this.
Updating my AlbumViewer to ASP.NET Core 2.1 and Angular 6.0
May 09, 2018 - Hood River, Oregon
Took some time to upgrade my AlbumViewer application to ASP.NET Core 2.1 RC and Angular 6.0. The .NET Core update was very smooth with only very minor adjustments required showing that Microsoft has smoothed out the update path significantly from the frenetic pace of past versions. The Angular update was a bit more involved primarily due to the changes in rxJS.
Dev Intersection 2017 Session Slides and Samples Posted
November 08, 2017 - Maui, Hawaii
I've posted my Session Slides and code samples from last week's DevIntersection conference on GitHub.
Handling HTML5 Client Route Fallbacks in ASP.NET Core
August 07, 2017 - Hood River, OR
HTML5 client routes work great on the client, but when deep linking into a site or pressing refresh in the browser, HTML5 client side routes have a nasty habit of turning into server HTTP requests. Requests to routes that the server is likely not configured for. In this post I look at why HTML5 client routes require server cooperation to handle and how to set them up on IIS and/or ASP.NET Core.
Updating my AlbumViewer Sample to ASP.NET Core 1.1 and Angular 4
March 31, 2017 - Maui, Hawaii
I updated my AlbumViewer sample application recently to the latest versions of ASP.NET Core (1.1) and the new .csproj project as well Angular 4
New CODE Magazine Article: Getting down to Business with ASP.NET Core
January 12, 2017 - Maui, Hawaii
The latest issue of CODE magazine features my `Getting down to Business with ASP.NET` Core article as the cover article. The article focuses on building an ASP.NET Core backend for an Angular 2 front application, covering all aspects of separating business and Web app logic, dealing with EF Core data access in related tables, CORS to be able to run across domains and simple authentication in a client centric REST service application. Check it out.
Error Handling and ExceptionFilter Dependency Injection for ASP.NET Core APIs
October 16, 2016 - Maui, Hawaii
Exception handling in API applications is important as errors - both handled and unhandled - need to be passed to clients in some way to let them display error information. ASP.NET's default error handling doesn't provide for object error results by default, but you can use an ExceptionFilter to intercept exceptions and format them yourself. In this post I look at how to create an API exception filter to create error object responses, and hook up custom logging of those errors to disk.
Bootstrap Modal Dialog showing under Modal Background
September 14, 2016 - Hood River, Oregon
On more than a few occasions I've run into issues with Bootstrap's Modal dialog rendering incorrectly with the dialog showing underneath the overlay. There are a number of ways around this problem, but none of them are universal that depend on how your pages are laid out. It's especially problematic for applications that dynamically render components where there's no good control on where the elements are placed outside of the components DOM containership. In this post, I describe a few of the workarounds and their limitations.
September 12, 2016 - Hood River, Oregon
Angular 2.0 and Typescript make it very easy to import external Typescript classes and references using the module loading functionality built into Typescript (and ES6). However, if you need to work with external libraries that aren't built with Typescript you need to do a little extra work in importing and referencing the external libraries. In this post I show two approaches for importing libraries as modules and dereferencing library globals so that the Typescript compiler is happy.
August 25, 2015 - Hood River, OR
July 18, 2015 - Hood River, OR
Right To Left (RTL) Text Display in Angular and ASP.NET
May 23, 2015 - Hood River, OR
Recently I was gently asked to add support for RTL language editing in my Westwind.Globalization library and the Web Resource Editor. The Editor supports displaying resources in all of its localized version, but it didn't respect the RTL setting for languages that required it. In this post I describe how RTL support works in browsers, how you can detect RTL support on a locale in .NET and demonstrate how I integrated basic RTL edit and display support for the Resource Editor using a custom Angular directive.
Angular Select List Value not binding with Static Values
May 21, 2015 - Hood River, OR
Ran into a problem converting from Angular 1.3 to 1.4rc a couple of days ago. The issue is that the way ng-model bindings work has changed, in that Angular 1.4 and later uses exact type matching for value comparisons which results in behavior changes. In my case I ran into a problem with static list values binding to a non-string value which caused the binding to effectively not work at all. Here's what the problem is and how to work around it.
Mixing $http Promises and $q Promises for cached Data
December 10, 2014 - Hood River, OR
When creating services it's often useful to return data from the $http service, or cached data that already exists. You can't however just return the cached data, but have to turn it into a promise so it matches the $http callback signature. Here's how to deal with this frequent scenario.
AngularJs and Promises with the $http Service
October 24, 2014 - Hood River, OR
The AngularJs $http object returns custom promises which can be surprising when you try to work with them. You can use either .then() or the easier .success() and .error() methods - at the cost of some inconsistency in Promise usage as these extension are specific to the $http functions. In this post I review a few different ways you can use promises and more importantly what the various $http methods return.
AngularJs ng-cloak Problems on large Pages
June 02, 2014 - Hood River, OR
Angular supports the ng-cloak directive to address hiding initially unrendered template content. I found out the hard way that sometimes with very large pages this mechanism doesn't quite work and still results in slight page flicker of the unrendered template content. In this post I describe the problem and several easy solutions to get around it the edge case scenario.
Routing to a Controller with no View in Angular
October 15, 2013 - Maui, HI
September 16, 2013 - Maui, HI