Home Angular is working, but $scope not showing up
Reply: 0

Angular is working, but $scope not showing up

user1250 Published in March 18, 2018, 2:08 am

I'm walking through a tutorial on Angular. I've tried following their Dev Guide and searching SO, I'm a little confused with all the versions of Angular.

I have a small app, a to-do app, and I can't get the $scope from my HomeCtrl to appear when the app loads the home template. When I load the home template, it's showing everything except the scope calls in the curly brackets {{ }}.

Here's what I have for my HomeCtrl.js:

 blocitoff.controller('HomeCtrl', ['$scope', '$firebaseArray', '$firebaseObject', function HomCtrl ($scope, $firebaseObject, $firebaseArray) {                          
    var ref = firebase.database().ref();
    var list = $firebaseArray(ref);
    $scope.data = $firebaseObject(ref);
    $scope.hello = "no way bill it worked!";                                

Here's what I have for my home.html:

<body ng-controller="HomeCtrl"> 
    <h2> hello there </h2>
    <h3> {{2+5}} </h3>
      I can add: {{ 1 + 2 }}.

    <p> {{$scope.hello}}</p>
    <p> {{ hello }} </p>

Thank you for any help or tips.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.381861 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO