I defined a local ref to routeParams service in my controller. routeParams:IRouteParamsService
Webstorm even code completed this for me and generated an import statement at the top of my controller:
import IRouteParamsService = angular.route.IRouteParamsService;
However, this produces a typescript error,
Module 'Angular' has no exported property 'route'
I tried removing it, I tried adding angular-ui-router.d.ts
to my TSD typings collection. Maybe I'm missing a different TSD definition file?
Here's the rest of the useful parts of my injector/constructor.
import ILocationProvider = angular.ILocationProvider;
import IRouteParamsService = angular.route.IRouteParamsService;
import IScope = angular.IScope;
interface ILoginControllerScope extends IScope {
userObject:any;
//...
}
class LoginController {
formType = 'login';
userModel:UserModel;
location:ILocationProvider;
routeParams: IRouteParamsService;
scope:ILoginControllerScope;
static $inject = ['$scope', '$location', 'userModel', '$routeParams'];
constructor($scope, $location, $userModel, routeParams ){
this.scope = $scope;
this.location = $location;
this.userModel = $userModel;
this.routeParams = routeParams;
//...