{"action":"opened","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/4136","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/4136/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/4136/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/4136/events","html_url":"https://github.com/NativeScript/NativeScript/issues/4136","id":226869821,"number":4136,"title":"ngIf on template not refresh on changes (NG 3.0)","user":{"login":"ignaciolarranaga","id":15932965,"avatar_url":"https://avatars2.githubusercontent.com/u/15932965?v=3","gravatar_id":"","url":"https://api.github.com/users/ignaciolarranaga","html_url":"https://github.com/ignaciolarranaga","followers_url":"https://api.github.com/users/ignaciolarranaga/followers","following_url":"https://api.github.com/users/ignaciolarranaga/following{/other_user}","gists_url":"https://api.github.com/users/ignaciolarranaga/gists{/gist_id}","starred_url":"https://api.github.com/users/ignaciolarranaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignaciolarranaga/subscriptions","organizations_url":"https://api.github.com/users/ignaciolarranaga/orgs","repos_url":"https://api.github.com/users/ignaciolarranaga/repos","events_url":"https://api.github.com/users/ignaciolarranaga/events{/privacy}","received_events_url":"https://api.github.com/users/ignaciolarranaga/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-07T15:43:41Z","updated_at":"2017-05-07T15:43:41Z","closed_at":null,"body":"## Please, provide the details below:\r\n\r\n### Tell us about the problem\r\nIf you refresh an ng-if template the change is not reflected.\r\nLet suppose for example this:\r\n```\r\n<ng-template [ngIf]=\"show\">\r\n    <Label text=\"I'm here\"></Label>\r\n</ng-template>\r\n```\r\nand you set a timer for 3 seconds to remove it:\r\n```\r\nsetTimeout(() => { this.show = false; console.log(\"Removing\"); }, 3000);\r\n```\r\nThe section should disappear at the timeout, but it doesn't happen.\r\n\r\n### Which platform(s) does your issue occur on?\r\niOS/Android/Both\r\n\r\n### Please provide the following version numbers that your issue occurs with:\r\n- CLI: 3.0.0\r\n- Cross-platform modules: 3.0.0\r\n- Runtime(s): 3.0.0/3.0.0\r\n\r\n### Please tell us how to recreate the issue in as much detail as possible.\r\n1. Create a sample project `tns create Sample --ng`\r\n2. Replace the content of the StackLayout of items.component.html with the following:\r\n```\r\n<ng-template [ngIf]=\"show\">\r\n    <Label text=\"I'm here\"></Label>\r\n</ng-template>\r\n```\r\n3. Add this variable to the ItemsComponent `show: boolean = true;` and a timeout to change it on the ngInit:\r\n```\r\nsetTimeout(() => { this.show = false; console.log(\"Removing\"); }, 3000);\r\n```\r\n\r\nReady you will see the message Removing but the item stays.\r\nIf you change to the *ngIf=\"show\" format it works, just change the template in this way and you will see it:\r\n```\r\n<ng-template [ngIf]=\"show\">\r\n    <Label text=\"I'm here1\"></Label>\r\n</ng-template>\r\n<Label text=\"I'm here2\" *ngIf=\"show\"></Label>\r\n```\r\nYou will se I'm here2 disappear while the number 1 does not.\r\n"}}
{"actor":{"display_login":"ignaciolarranaga"}}