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) Controllers and Scope Creating a Controller

Can't log using Console.log

This is my HTML

<h1>My ToDos</h1>
  <div ng-contoller="mainCtrl" class="list">
  <input type="checkbox"/>
  <label class="editing-label">A Simple To Do</label>
  <input class="editing-label" type="text"/>
  <div class="actions">
  <a href="" ng-click="helloWorld()">Edit</a>
  <a href="">Save</a>
  <a href="" class="delete">Delete</a>

  </div>
  </div>


AND this is my App.js


angular.module("todoListApp", [])
.controller('mainCtrl', function($scope){
$scope.helloWorld = function(){
console.log("This is a helloWorld controller function inside the mainCtrl controller");
};
});

1 Answer

Andrew Bush
Andrew Bush
10,953 Points

<div ng-contoller="mainCtrl" class="list">

You have a spelling error. contoller vs controller