title: ionic 2 "Type '{}' is not assignable to type 'any[]"
body: <p>There is an ionic 2 project.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>export class PostPage {
    posts : [any];
  
    constructor(private nav:NavController,
      private postSvc: PostService) {
    }
  
    ngOnInit() {    
      this.postSvc.load()
        .subscribe( data =&gt; {
            this.posts = data;
        });
    }
  </code></pre>
  
  <p>The error message is for <strong>this.posts = data</strong>. I defined this.posts as [any]. Also in my PostService I defined the data as [] too. </p>
  
  <p>Code for PostService:</p>
  
  <pre><code>load() {
      return new Observable( observer =&gt; {
  
        var Post = Parse.Object.extend("Post");
        var query = new Parse.Query(Post);
        query.find({
          success: results =&gt; {
            var data = [];
            for (var i = 0; i &lt; results.length; i++) {
              var object = results[i];
              var item = this.createPost(object);
              data.push(item);
            }
            observer.next(data);
            observer.complete();
          },
          error: error =&gt; {
            observer.error(error.message);
          }
        });
      });
    }
  </code></pre>
  
  <p>I got the error message:</p>
  
  <blockquote>
    <p>Type '{}' is not assignable to type 'any[]</p>
  </blockquote>
  
  <p>As you see, I call <strong>observer.next(data)</strong> where the <strong>data</strong> is []. I don't understand why my ionic 2 think my data is a '{}' . Any idea? Thanks.</p>