title: Converting Angular's $scope to (Controller as) while using $http
body: <p>I'm using Angular 1.3 I have changed my code to use <code>Controller as</code> from using $scope. 
  I have a url: </p>
  
  <p><code>http://localhost:3640/api/v1/topics</code> </p>
  
  <p>That gets the following json:</p>
  
  <pre><code>[
    {
      topicId: 17,
      title: "This is another BRAND SPANKIN new topic",
      body: "This is a message in the body of another topic ftw!",
      created: "2014-11-27T05:37:49.993",
      replies = null
    },
  
    {
      topicId: 18,
      title: "This is another BRAND new topic",
      body: "This is a message in the body of a topic wow!",
      created: "2014-11-27T05:37:49.993",
      replies = null
    }
  ]
  </code></pre>
  
  <p>I also have a page called index-home.js</p>
  
  <pre><code>var app = angular.module("myApp", []);
  
  app.controller("homeIndexController", ["$http", function ($http) {
  
      var msg = this;
      msg.dataCount = 0;
      msg.replies = [];
  
      $http.get("/api/v1/topics?includeReplies=true")
          .success(function(data) {
              //Success
              msg.replies = data;
          })
          .error(function() {
              //Error
              alert('error/failed');
          });
  
  }]);
  </code></pre>
  
  <p>On my page I use the following bindings:
      </p>
  
  <pre><code>&lt;div id="ngController" ng-controller="homeIndexController as hic"&gt;
    ...
    &lt;h3&gt;Message count: {{hic.dataCount}}&lt;/h3&gt;
    ...
    &lt;div class="message row" data-ng-repeat="i in hic.data"&gt;
    &lt;div class="title"&gt;{{i.title}}&lt;/div&gt;
    &lt;div class="date"&gt;{{i.created}}&lt;/div&gt;
    &lt;div class="contents"&gt;{{i.body}}&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I know that the url in the $http is working because I tried it by itself in the browser and fiddler and it returned the json. But when I use it in my angular app I get the .error result (which is a alert saying FAIL.</p>
  
  <p>I have tried removing the <code>http://localhost:3640</code> and just using <code>/api/v1/topics</code> when I do that, I don't get the error result anymore. I know my controller is working and binding to the page because I get back 0 for <code>dataCount</code>.</p>
  
  <p>What am I doing wrong in the <code>$http</code> method? Is my syntax wrong?</p>