title: Ionic view not updating page when opened second time
body: <p>i am using ionic 2.I am facing lots of problem in ionic 2. When i navigate push to show the data. At first time its works fine. After that its printing the data in console. But not showing in screen.</p>
  <p>And also in terminal, when i do some changes in .ts,.html,.scss file.Its not updating . I need to close my terminal and again i need to do <code>ionic serve --lab</code>.. so is there any change the <code>.ts</code> file to <code>.js</code>.  And if yes, does the syntax i need to change any thing inside new <code> .js</code> file.</p>
  <p>Thanks,
  sathish</p>
  <h1>Update :</h1>
  <p>I have home screen and by push i am passing the <code>cat id </code> to pupulate the data in my settings.html based on the cat id that i am passing from home.html:</p>
  <p>my <code>home.html</code></p>
  <pre><code>  &lt;div class=&quot;item item-body no-padding&quot; style=&quot;border-width: 0px !important;&quot;&gt;  
  
    &lt;div class=&quot;row no-padding&quot;  *ngFor=&quot;let data of Catdata;let i = index&quot; (click)=&quot;showDetails(Catdata[i].CatID)&quot;&gt;
       &lt;ng-container *ngIf=&quot; i % 2 === 0&quot;&gt;
  
            &lt;div class=&quot;col col-50 custom-design2&quot; style=&quot;background: url(img url) no-repeat center;background-size: cover;&quot;&gt;
                 &lt;div class=&quot;custom-design1&quot;&gt;&lt;span class=&quot;grid-title&quot;&gt;{{Catdata[i].CategoryName}}&lt;/span&gt;&lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class=&quot;col col-50 custom-design2&quot; style=&quot;background: url(img url) no-repeat center;background-size: cover;&quot;&gt;
                   &lt;div class=&quot;custom-design1&quot;&gt;&lt;span class=&quot;grid-title&quot;&gt;{{Catdata[i+1].CategoryName}}&lt;/span&gt;&lt;/div&gt;
               &lt;/div&gt;
  
  
       &lt;/ng-container&gt;
  &lt;/div&gt; 
  
     
  &lt;/div&gt;
  </code></pre>
  <p>my home.ts:</p>
  <pre><code>data: any;
   
     Catdata: any;
  
      constructor(   public alertCtrl: AlertController,
          public modalCtrl: ModalController,
          public navCtrl: NavController,
          public http:Http,
          public authService: AuthService) {
      this.submit();
        }
       submit() {     
       
          this.authService.categ(this.loginData).then((result) =&gt; {
          
            this.data = result;
      
             if(this.data.status == 1)
             {
             this.Catdata = this.data.CatgeoryList;
      
             
                 for(let i=0; i&lt;this.Catdata.length; i++) {
                     console.log(this.Catdata[i].CategoryName);
                 }
      
             }
      
             else if(this.data.status == 0) {
      
           let alert = this.alertCtrl.create({
          title: 'Error',
          subTitle: 'Please Enter Valid Username &amp; Password',
          buttons: ['OK']
        });
        alert.present();
             }
      
          }, (err) =&gt; {
          
          
          });     
        } 
      
      
      public showDetails(catId: any): void {
          this.navCtrl.push(SettingsPage, { clickedcatId: catId });
      
      
      }
  </code></pre>
  <p>My settings.html:</p>
  <pre><code>&lt;div class=&quot;item item-body no-padding&quot; style=&quot;border-width: 0px !important;&quot;&gt;  
  
    &lt;div class=&quot;row no-padding&quot;  *ngFor=&quot;let data of Catdata;let i = index&quot; (click)=&quot;opndetailpage()&quot;&gt;
       &lt;ng-container *ngIf=&quot; i % 2 === 0&quot;&gt;
  
            &lt;div class=&quot;col col-50 custom-design2&quot; style=&quot;background: url(img url) no-repeat center;background-size: cover;&quot;&gt;
                 &lt;div class=&quot;custom-design1&quot;&gt;&lt;span class=&quot;grid-title&quot;&gt;{{data[i].SubCategoryName}}&lt;/span&gt;&lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class=&quot;col col-50 custom-design2&quot; style=&quot;background: url(img url) no-repeat center;background-size: cover;&quot;&gt;
                   &lt;div class=&quot;custom-design1&quot;&gt;&lt;span class=&quot;grid-title&quot;&gt;{{data[i+1].SubCategoryName}}&lt;/span&gt;&lt;/div&gt;
               &lt;/div&gt;
  
  
       &lt;/ng-container&gt;
  &lt;/div&gt; 
  
     
  &lt;/div&gt;
  </code></pre>
  <p>my <code>settings.ts</code></p>
  <pre><code> data: any;
   
     Catdata: any;
  
      constructor( public alertCtrl: AlertController,
          public modalCtrl: ModalController,
          public navCtrl: NavController,
          public http:Http,
          public authService: AuthService,private navParams: NavParams) {
      
          this.categoryid = navParams.get('clickedcatId');
          console.log(this.categoryid);
      
      this.another();
      
      
        }
      
        another() {
      
         this.subcatdata = { CatID:this.categoryid};
        
        this.authService.subcatte(this.subcatdata).then((result) =&gt; {
          
            this.data = result;
      
            console.log (this.data);
      
             if(this.data.status == 1)
             {
             this.Catdata = this.data.SubCatgeoryList;
      
             
                 for(let i=0; i&lt;this.Catdata.length; i++) {
                     console.log(this.Catdata[i].SubCategoryName);
                 }
      
             }
      
             else if(this.data.status == 0) {
      
           let alert = this.alertCtrl.create({
          title: 'Error',
          subTitle: 'Please Enter Valid Username &amp; Password',
          buttons: ['OK']
        });
        alert.present();
             }
      
          }, (err) =&gt; {
          
          
          });     
      }
  </code></pre>
  <p>My <code>authservice.ts</code></p>
  <p>This is fine:</p>
  <pre><code>categ(cat: any) {
      return new Promise((resolve, reject) =&gt; {
          let headers = new Headers();
          headers.append('Content-Type', 'application/json');
  
          this.http.post(apiUrl+'categories.php', JSON.stringify(cat), {headers: headers})
            .subscribe(res =&gt; {
              resolve(res.json());
            }, (err) =&gt; {
              reject(err);
            });
      });
    }
  
     subcatte(subcat: any) {
      return new Promise((resolve, reject) =&gt; {
          let headers = new Headers();
          headers.append('Content-Type', 'application/json');
  
          this.http.post(apiUrl+'subcategory.php', JSON.stringify(subcat), {headers: headers})
            .subscribe(res =&gt; {
              resolve(res.json());
            }, (err) =&gt; {
              reject(err);
            });
      });
    }
    
  </code></pre>