New to TypeScript and trying to convert from js to ts (using angular 1.x). Here's a controller. Having issues converting to ts. "module" is a custom data element on the ui-router state provider.
(function(module) {
"use strict";
module.controller("aboutController", ["$state", function($state) {
var vm = this;
// todo: pass the module to the service to get the content for the about page from the db
// $state.current.data.module
vm.content = $state.current.data.module;
}
]);
} (angular.module("app.ui")));
My latest attempt using ts:
module myApp.ui {
"use strict";
class AboutController {
constructor(private $state: ng.ui.IStateProvider) {
this.content = $state.current.data.module;
}
}
angular.module("app.ui").controller("aboutController", AboutController);
}
content: any
above your constructor (or below)