There are a lot of resources and examples available on the web for learning AngularJS(1.x branch). Some are good, some are bad and some are super ugly and confusing. The recommended approach for building scalable applications with AngularJS is to follow the controllerAs syntax. In this post, I will be breaking down a really ugly legacy controller and converting it to … [Read more...] about Refactor Legacy AngularJS Controller to ControllerAs Syntax
AngularJS (1x branch)
AngularJS Add $scope to Controller Unit Test
First off, you really shouldn't be adding $scope to your controller. Always use ControllerAs syntax as a best practice. If you aren't familiar, John Papa has an excellent style guide for AngularJS coding practices: Angular 1 Style Guide Alright, now that we got that out of the way. You probably have an edge case or something where you need to add it. Cool, I got you covered. … [Read more...] about AngularJS Add $scope to Controller Unit Test