Sometimes you run into a situation where you need to define a custom compare function for $watch to use in Angular 1 change detection. This was the case for me when I needed to check for changes on a rather deeply nested class. The Problem Angular 1 uses $scope.$watch…
I'm in the middle of migrating a project from Angular 1 to Angular 2. Every now and then I hit a bump in the road where architecture/design decisions in the Angular 1 version don't always have a clear path into the best practices of Angular 2. I ran into…
Note: This is a follow up to Ditch Your Angular 1.x Watchers! Quick-Swap Them for Observables It's been 2 months since I wrote about swapping $watch for observeOnScope, so I thought I'd post a follow up! In that 2 months we have finally found the time to educate the…
Converting $watch to observeOnScope Note: I wrote this article to help my teammates understand my quest to eradicate $watch in our application. I hope it helps someone else, too! Observables are very powerful and have a lot of different functionality, but they can also be very simple to use. Here…
In my last post, I talked about how I'm attempting to port my current Angular 1 project to Angular2. I decided to use the CLI since it forces you to use the current "best practices." After setting up my first route, I decided to pull over the HTML template and…
UPDATE The "new-new" router has dropped, and the Angular CLI has turned off the router generator until it has integrated it. In the interim, I've just been generating a component, renaming all of the files with a "+" if I want that route lazy loaded, then manually inserting the router config…