How to avoid typescript errors in ionic2 application?
<p>Hi I am Working With <code>Ionic2</code>.Here I got some errors while using <code>JSON.parse(this.items1)</code> Actually that is not an error in <code>Javascript</code> but it shows error in ts file ... How to avoid these errors?</p>

<p><strong>Error</strong> </p>

<pre><code> TypeScript error: E:/Projects 2016/TaskBean/mytaskbeanapp/app/pages/list/list.ts
(38,21): Error TS2345: Argument of type 'any[]' is not assignable to parameter o
f type 'string'.
10.3 MB bytes written (2.13 seconds)
</code></pre>

<p><strong>Code</strong> </p>

<pre><code>import {Component,Type} from '@angular/core';
import {ModalController, NavController, NavParams,MenuController} from 'ionic-angular';
import {ItemDetailsPage} from '../item-details/item-details'; 
import {AddItemPage} from '../addtask/add';
import {ItemDetailPage} from '../item-detail/item-detail';
import {Data} from '../providers/data';
import {Http, Response, Headers, Request, RequestOptions, RequestMethod, URLSearchParams} from 
'@angular/http';
import 'rxjs/Rx';

@Component({
  templateUrl: 'build/pages/list/list.html',
})
export class ListPage  extends Type {

 selectedItem: any;
  private items = [];
  private items1 = [];
   result: Object;
    public mydata = [];

   projectid:string;
  constructor(private nav: NavController, navParams: NavParams,public menu:MenuController,private dataService: Data, private modalCtrl: ModalController,public http:Http) {
   this.result = {friends:[]};



      http.get('http://192.168.0.26:9000/api/task/counttask?projectid=-1&amp;Teamid=-1&amp;RoleId=-1&amp;status=1&amp;PID=-1&amp;mytasks=0&amp;alltasks=0&amp;page=1&amp;row=15&amp;priorityid=-1&amp;typeid=-1&amp;taskname=&amp;JSON&amp;_=1471520478215')

    .map((res: Response) =&gt; res.json())

.subscribe(

                  res =&gt; { this.items1 = res;
            **alert(JSON.parse(this.items1))**
try
{

    alert(JSON.parse(JSON.parse(this.items1).Data));


    window.localStorage['mydata']=this.items;


    }
    catch(e)
    {

    }





         },

        () =&gt; console.log('getUserStatus Complete') // complete
    );



 this.selectedItem = navParams.get('item');
 this.menu.enable(true, 'mymenu');
 this.dataService.getData().then((todos) =&gt; {



        if(todos){
            this.items = JSON.parse(todos); 
        }

    });

  }
  itemTapped(event, item) {

    this.nav.push(ItemDetailsPage, {
      item: item
    });
  }
  addItem(){

    let addModal = this.modalCtrl.create(AddItemPage);

    addModal.onDidDismiss((item) =&gt; {

      if(item){
        this.saveItem(item);
      }

    });

    addModal.present();

  }

  saveItem(item){
    this.items.push(item);
    this.dataService.save(this.items);
  }

  viewItem(item){
    this.nav.push(ItemDetailPage, {
      item: item
    });
  }

  removeItem(item){

    for(var i = 0; i &lt; this.items.length; i++) {

      if(this.items[i] == item){
        this.items.splice(i, 1);
                              }

    }

  }
}
</code></pre>