Skip to content

TypeScript 2.4.1 - TS2345 - "Property 'push' is missing in type #16802

Closed
@simonua

Description

@simonua

TypeScript Version: 2.4.1

I will preface this with me being unclear whether this is a bug or my misunderstanding of the error (more likely), but I hope I can get some traction on it here nevertheless, please. And, thank you!

Code

This code used to work with 2.3.4 but fails in 2.4.1

// A *self-contained* demonstration of the problem follows...
module app {
    class TypeScript24Controller {
        static $inject = ['$log'];

        constructor(private $log: ng.ILogService) {
            $log.debug('TypeScript24Controller constructor called.');
        }
    }

    angular.module('app').controller('TypeScript24Controller', TypeScript24Controller);
}

Stripping private in my constructor eliminates the error, but I do want the private property created.

module app {
    class TypeScript24Controller {
        static $inject = ['$log'];

        constructor($log: ng.ILogService) {
            $log.debug('TypeScript24Controller constructor called.');
        }
    }

    angular.module('app').controller('TypeScript24Controller', TypeScript24Controller);
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions