"Controller as" syntax for ng-view

angularjs, ngroute

Solution

You can use the `controller as` syntax when you specify your controller in the `$routeProvider` configuration.

e.g.

$routeProvider
    .when('/somePath', {
        template: htmlTemplate,
        controller: 'myController as ctrl'
    });

Problem

I was wondering how I use the `Controller as` syntax in combination with `ngRoute` since I cant do `ng-controller="Controller as ctrl"`

Original source