{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/11978","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/11978/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/11978/comments","events_url":"https://api.github.com/repos/angular/angular/issues/11978/events","html_url":"https://github.com/angular/angular/issues/11978","id":179995705,"number":11978,"title":"AOT Compiler requires public properties, while non-AOT allows private properties","user":{"login":"schungx","id":661318,"avatar_url":"https://avatars.githubusercontent.com/u/661318?v=3","gravatar_id":"","url":"https://api.github.com/users/schungx","html_url":"https://github.com/schungx","followers_url":"https://api.github.com/users/schungx/followers","following_url":"https://api.github.com/users/schungx/following{/other_user}","gists_url":"https://api.github.com/users/schungx/gists{/gist_id}","starred_url":"https://api.github.com/users/schungx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schungx/subscriptions","organizations_url":"https://api.github.com/users/schungx/orgs","repos_url":"https://api.github.com/users/schungx/repos","events_url":"https://api.github.com/users/schungx/events{/privacy}","received_events_url":"https://api.github.com/users/schungx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-09-29T09:22:30Z","updated_at":"2016-12-26T16:03:06Z","closed_at":"2016-09-29T10:18:51Z","body":"**I'm submitting a ...**  (check one with \"x\")\n\n```\n[X] bug report => search github for a similar issue or PR before submitting\n[ ] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior** \nWhen writing a component, fields referred inside a template is allowed to be declared `private` and it will still work.\n\nHowever, such `private` fields generate errors with the AOT compiler.  They must be turned `public`.\n\n**Expected behavior**\nBe consistent.  Either allow or not allow.\n\n**Reproduction of the problem**\n\n``` .ts\ntemplate: \"<div>{{hello}}</div>\"\n\nclass someModule {\n    private hello: string;            <-- doesn't work with AOT compiler\n}\n```\n\n**Please tell us about your environment:**\nWindows 10.\n- **Angular version:** 2.0.0\n- **Browser:** all\n- **Language:** TypeScript\n- **Node (for AoT issues):** `node --version` =  v4.3.1\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/269222846","html_url":"https://github.com/angular/angular/issues/11978#issuecomment-269222846","issue_url":"https://api.github.com/repos/angular/angular/issues/11978","id":269222846,"user":{"login":"schungx","id":661318,"avatar_url":"https://avatars.githubusercontent.com/u/661318?v=3","gravatar_id":"","url":"https://api.github.com/users/schungx","html_url":"https://github.com/schungx","followers_url":"https://api.github.com/users/schungx/followers","following_url":"https://api.github.com/users/schungx/following{/other_user}","gists_url":"https://api.github.com/users/schungx/gists{/gist_id}","starred_url":"https://api.github.com/users/schungx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schungx/subscriptions","organizations_url":"https://api.github.com/users/schungx/orgs","repos_url":"https://api.github.com/users/schungx/repos","events_url":"https://api.github.com/users/schungx/events{/privacy}","received_events_url":"https://api.github.com/users/schungx/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T16:03:06Z","updated_at":"2016-12-26T16:03:06Z","body":"Well, I second @aluanhaddad 's suggestion that `public` is required for Angular 2 components.  The fact that it works fine even when properties are declared `private` is an unfortunate by-product of Angular 2 emitting compiling to JavaScript which has no private properties.\r\n\r\nA user of Angular 2 should not need to know that `private` is not supposed to work (but actually works due to the oddities of JavaScript).\r\n\r\nNow, all `private` properties continue to work merrily, with the poor user writing millions of lines of Angular 2 code, only to find that when compiled AOT they suddenly generate thousands of errors!\r\n\r\nSaid poor user would then have to manually correct all the `private` properties into `public` ones... cursing all the way whoever who decided in the first place that documentation is not needed.\r\n\r\nSo, I believe somewhere in the Angular 2 docs should be words saying \"WARNING: LARK'S VOMIT\" in big bold letters, followed by: \"DO NOT USE PRIVATE PROPERTIES FOR BINDING, OR AOT WON'T WORK.  YOU HAVE BEEN WARNED!\"\r\n"}}
{"actor":{"display_login":"schungx"}}