Using "Controller as" Syntax in Angular Routes
I’ve been using the new “Controller as” syntax in Angular for a few months, but today I realized I didn’t know how to use the syntax for route controllers. After spending a few minutes scratching my head and “Googling with Bing”, I figured it out. The $routeProvider supports a “controllerAs” property for routes:
1 2 3 4 5 6 7
That’s it. Not very complicated, but hopefully it will save someone a few minutes of research.