UI Router's Resolve and TypeScript -
i'm curious how go using ui router's resolve typescript.
.state("signin.notactivated", <ng.ui.istate> { controller: "signinctrl", controlleras: "signin", url: "/notactivated", resolve: { inprogress: function() { return { formdata : null } } } })
in controller, have injected resolve.
constructor(public $state : angular.ui.istate, private inprogress) { this.init(); } private init = () => { this.somedata = this.inprogress.formdata; // error }
i getting unknown provider error, because typescript trying register service.
can done?
try injecting this:
static $inject = ['$state', 'inprogress']; constructor(public $state : angular.ui.istate, private inprogress) { this.init(); }
Comments
Post a Comment