{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/4878","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/4878/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/4878/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/4878/events","html_url":"https://github.com/webpack/webpack/issues/4878","id":228947091,"number":4878,"title":"Can't use static methods of angular service (TypeScript)","user":{"login":"dirkvanvugt01","id":18282005,"avatar_url":"https://avatars1.githubusercontent.com/u/18282005?v=3","gravatar_id":"","url":"https://api.github.com/users/dirkvanvugt01","html_url":"https://github.com/dirkvanvugt01","followers_url":"https://api.github.com/users/dirkvanvugt01/followers","following_url":"https://api.github.com/users/dirkvanvugt01/following{/other_user}","gists_url":"https://api.github.com/users/dirkvanvugt01/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkvanvugt01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkvanvugt01/subscriptions","organizations_url":"https://api.github.com/users/dirkvanvugt01/orgs","repos_url":"https://api.github.com/users/dirkvanvugt01/repos","events_url":"https://api.github.com/users/dirkvanvugt01/events{/privacy}","received_events_url":"https://api.github.com/users/dirkvanvugt01/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-16T08:04:25Z","updated_at":"2017-05-18T04:22:53Z","closed_at":"2017-05-18T04:22:53Z","body":"<!-- Please don't delete this template or we'll close your issue -->\r\n<!-- Before creating an issue please make sure you are using the latest version of webpack. -->\r\n<!-- Also consider trying the webpack@beta version, maybe it's already fixed. -->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n\r\nA bug\r\n\r\n<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->\r\n<!-- Issues which contain questions or support requests will be closed. -->\r\n\r\n**What is the current behavior?**\r\n\r\nI have implemented an angular service to combine methods that are used throughout my app in multiple components. \r\nI would like to make methods static since they only return data that isn't bound to the service's instance. \r\nHowever when I make a method static Webpack seems to miss the reference to the service.\r\n\r\nNote: this is all run on my local machine\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n\r\n```\r\nmodule X.Y {\r\n    class Z {\r\n    \r\n        constructor() {\r\n        }\r\n    \r\n        public static sorting(z: any) {\r\n            //do stuff\r\n        \r\n            return z;\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n<!-- A great way to do this is to provide your configuration via a GitHub gist. -->\r\n<!-- Best provide a minimal reproduceable repo -->\r\n<!-- If your issue is caused by a plugin or loader file the issue on the plugin/loader repo -->\r\n\r\n**What is the expected behavior?**\r\n\r\nWhen I want to use this method I'd expect to use it like this:\r\n\r\n```\r\nlet valuesForSorting = ['a', 'b', 'c'];\r\nlet sortedValues = X.Y.Z.sorting(valuesForSorting);\r\n```\r\nHowever I get a console error saying\r\nReferenceError: X is not defined\r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?**\r\n\r\n\r\n\r\n**Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.**\r\n\r\nChrome, PhpStorm 2017.1.3, Webpack 2.4.1, Angular 1.5.3, TypeScript 2.2.2, Windows 10\r\n\r\n[webpack-issue.zip](https://github.com/webpack/webpack/files/1003604/webpack-issue.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/302296751","html_url":"https://github.com/webpack/webpack/issues/4878#issuecomment-302296751","issue_url":"https://api.github.com/repos/webpack/webpack/issues/4878","id":302296751,"user":{"login":"sokra","id":1365881,"avatar_url":"https://avatars3.githubusercontent.com/u/1365881?v=3","gravatar_id":"","url":"https://api.github.com/users/sokra","html_url":"https://github.com/sokra","followers_url":"https://api.github.com/users/sokra/followers","following_url":"https://api.github.com/users/sokra/following{/other_user}","gists_url":"https://api.github.com/users/sokra/gists{/gist_id}","starred_url":"https://api.github.com/users/sokra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sokra/subscriptions","organizations_url":"https://api.github.com/users/sokra/orgs","repos_url":"https://api.github.com/users/sokra/repos","events_url":"https://api.github.com/users/sokra/events{/privacy}","received_events_url":"https://api.github.com/users/sokra/received_events","type":"User","site_admin":false},"created_at":"2017-05-18T04:22:53Z","updated_at":"2017-05-18T04:22:53Z","body":"Looks like your are using typescript namespaces. This is not related to webpack. Don't use them for modular applications.\r\n\r\n\r\nPlease submit support requests and questions to StackOverflow using the tag [[webpack]](http://stackoverflow.com/tags/webpack). StackOverflow is better suited for this kind of support. The issue tracker is for bug reports and feature discussions. See also [our CONTRIBUTING guidelines](https://github.com/webpack/webpack/blob/master/CONTRIBUTING.md).\r\n"}}
{"actor":{"display_login":"sokra"}}