{"action":"opened","issue":{"url":"https://api.github.com/repos/aurelia/documentation/issues/170","labels_url":"https://api.github.com/repos/aurelia/documentation/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/documentation/issues/170/comments","events_url":"https://api.github.com/repos/aurelia/documentation/issues/170/events","html_url":"https://github.com/aurelia/documentation/issues/170","id":117713034,"number":170,"title":"Useless fields initialization in TS examples","user":{"login":"jods4","id":3832820,"avatar_url":"https://avatars.githubusercontent.com/u/3832820?v=3","gravatar_id":"","url":"https://api.github.com/users/jods4","html_url":"https://github.com/jods4","followers_url":"https://api.github.com/users/jods4/followers","following_url":"https://api.github.com/users/jods4/following{/other_user}","gists_url":"https://api.github.com/users/jods4/gists{/gist_id}","starred_url":"https://api.github.com/users/jods4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jods4/subscriptions","organizations_url":"https://api.github.com/users/jods4/orgs","repos_url":"https://api.github.com/users/jods4/repos","events_url":"https://api.github.com/users/jods4/events{/privacy}","received_events_url":"https://api.github.com/users/jods4/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-19T00:23:50Z","updated_at":"2015-11-19T00:23:50Z","closed_at":null,"body":"I was not sure where to report this, but I noticed that in the new documentation many TypeScript examples assign fields in their ctor. For example, from \"Declaring dependencies\" in the cheat sheet:\r\n\r\n```ts\r\nexport class CustomerDetail {\r\n  constructor(private dep1: Dep1, private dep2: Dep2){\r\n    this.dep1 = dep1;\r\n    this.dep2 = dep2;\r\n  }\r\n}\r\n```\r\n\r\nThe two lines in the ctor are redundant with the TS generated code. \r\n\r\nWhen you put a visibility modifier before a ctor parameter it actually does two things:\r\n- It means you declare a class field with the specified visibility and the same name as the parameter.\r\n- It initializes the generated field with the parameter value."}}