-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version:
1.8.10
Code
MyService.ts
// A self-contained demonstration of the problem follows...
import {ngModule} from './../module.ts';
export class MyService {
}
ngModule.service('myService', MyService); // <- REALLY IMPORTANT SIDE-EFFECT
MyComponent.ts
import {MyService} from './MyService.ts';
class MyComponent {
constructor(private myService: MyService) { }
// ...
}
Expected behavior:
(I know this sort-of-tree-shaking is "by design", but by the principle of least astonishment, expected behavior is this)
MyComponent.js
var MyService_1 = require('./MyService');
var MyComponent = (function() {
function MyComponent(myService) {
this.myService = myService;
};
// ...
})();
Actual behavior:
MyComponent.js
var MyComponent = (function() {
function MyComponent(myService) {
this.myService = myService;
};
// ...
})();
And then AngularJS is all "myServiceProvider not found" and crashy.
Cliveburr, simonbengtsson, MichaelZalla, PSeitz, minomikula and 26 more
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript