Skip to content

Suggestion: Only create global variable for module if something tangible is exported #8668

Closed
@zolem

Description

@zolem

I think it would be great if when creating a module it would only create a global variable for that module if something tangible is exported. Whenever I use Typescript with angular I have no need for the global variable.

module a{
    export interface IController{
    }
    angular.module("module").controller("controller", Controller);
    class Controller{
    }
}

Nothing tangible is exported here so there is no need to create a global variable of "a".

The nice thing is I can still use the interfaces at design time because of the module and interface. But at runtime there is no need for the javascript variable to exist as it will just be an empty object anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn idea for TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it adds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions