Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Imports left out of module dependencies when not directly assigned or assigned to. #2132

Copy link
Copy link

Description

@QueueHammer
Issue body actions

In the following case a module defined in TypeScript will not be included in the required modules of the module.

import something = require('Something');

angular.module('app')
.controller('somethingController', [
  'definedInSomething', function (definedInSomething: something.myInterfaceOrType) {
    definedInSomething; //Not defined, and not reached because 'definedInSomething' was not included
  }
]);

The module that is generated is:

define(["require", "exports"], function(require, exports) {

Instead of:

define(["require", "exports", 'Something'], function(require, exports, Something) {

Assigning something to another value or accessing the properties of something will cause it to be added to the module signature.

In any case the values defined in the import x = require('y') should be added to the module dependencies. The author has explicitly added the reference and as such has an expectation that it will be included in the dependencies of the current module.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" insteadDuplicateAn existing issue was already createdAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.