Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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>


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