Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AngularJS Basics (1.x) Using Angular's Built In Directives Adding Data To Your App Using ng-model

ng inspector not showing any controller or model or function.

I am trying to use ng-model but nothing, i cannot see anything in ng-inspector as its showing blank.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>To Do list</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js">

    </script>
        <script type="text/javascript" src="js/app.js"></script>
</head>
<body>
    <header>
        <h1>To Do List</h1>
    </header>

    <div ng-controller="mainCtrl" class="list">
        <input type="checkbox">
        <label class="editing-label">A Sample to do</label>
        <input ng-model="todo" type="text">
    </div>
    <div class="actions">
        <a href="">Edit</a>
        <a href="" ng-click="helloworld()">Save</a>
        <a href="">Delete</a>
    </div>
</body>
</html>

and my todo.js

angular.module("todoListApp", [])

  .controller('mainCtrl', function($scope){
    $scope.helloWorld = function(){
      console.log('Hello there! This is the helloWorld controller function, in the mainCtrl');
    };
  })

  .controller('coolCtrl', function($scope){
    $scope.whoAmI = function(){  
      console.log("Hello there, this is the coolCtrl function");
    };
  })

  .conroller('imASibling', function($scope){
    $scope.foobar = 1234;
    //do something
  });

1 Answer

I found my answer, i didn't have ng-controller on my body tag.