title: Angular 2 do not refresh view after array push in ngOnInit promise
body: <p>I created a NativeScript app with angular 2, i have an array of objects that i expect to see in the frontend of the application. the behaviour is that if i push an object into the array directly inside the ngOnInit() it works, but if i create a promise in the ngOnInit() it doesn't work. here is the code:</p>
  
  <pre><code>export class DashboardComponent {
       stories: Story[] = [];
  
       pushArray() {
           let story:Story = new Story(1,1,"ASD", "pushed");
           this.stories.push(story);
       }
  
       ngOnInit() {
           this.pushArray(); //this is shown
  
           var promise = new Promise((resolve)=&gt;{
               resolve(42);
               console.log("promise hit");
           });
  
           promise.then(x=&gt; {
               this.pushArray(); //this is NOT shown
           });
       }
   }
  </code></pre>
  
  <p>the relative html is: </p>
  
  <pre><code>&lt;Label *ngFor="let story of stories" [text]='story.message'&gt;&lt;/Label&gt;
  </code></pre>
  
  <p>when the app starts i see only one push, but than i created a button that trigger a "console.log(JSON.stringify(this.stories));" and at that moment, when i tap the button, the ui seems to detects the changed array, and the other pushed object appears.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I created a more simple example in this thread: <a href="https://stackoverflow.com/questions/39203004/angular-2-when-i-change-a-variable-in-a-promise-than-in-ngoninit-the-view-doesn">Angular 2: when i change a variable in a promise.than in ngOnInit the view doesn&#39;t refresh</a></p>