troubleshooting Question

Angular expressions will not show if $http is called.

Avatar of quest_capital
quest_capital asked on
HTMLAngular.NET Programming
3 Comments3 Solutions128 ViewsLast Modified:
I have a expressions that will not show if $http is called:

function StaysCtrl($scope, $http, $state, Idle, notify, AuthSrv, appResource) {

    // Will not show up if I make a $http call
    this.helloText = 'Welcome to Stays';

    //appResource.query(function (data) {
    //    $scope.stays = data;

    // If I comment out this $http call the helloText will show up.
        method: 'GET',
        dataType: 'json',
        headers: {
            "Content-Type": "application/json"
        url: 'http://localhost:6060/api/stay/10/desc',
        data: JSON.stringify(),
    }).success(function (data) {
        $scope.stays = data;

<div ng-controller="StaysCtrl as stays" class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="text-center m-t-lg">
                <small>Configure in config.js as minor state.</small>

    <div ng-repeat="stay in stays">

What am I missing?
Join our community to see this answer!
Unlock 3 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros