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 trialShreyas Ananth
861 PointsNothing shows in console when i click on save button... help please
I have tried my best to follow the video and create a simple controller but seems to happen. Help please.
here is the app.js: //This is the main file for our application
angular.module("todoListApp",[]) .controller('mainCrtl', function($scope){ $scope.helloWorld = function(){ console.log("This is a hello world controller"); }; });
here is index.html: <html lang="en"> <head> <title></title> <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'> <link href="styles/main.css" rel="stylesheet" type="text/css" </head> <body ng-app="todoListApp">
<h1>My Todo</h1>
<div ngController="mainCrtl" class="list"> <input type="checkbox" /> <label class="editing-label">A Sample todo</label> <input class="editing-label" type="text" /> <div class="actions"> <a href="">edit</a> <a href="" ng-click="helloWorld()">save</a> <a href="" class="delete">delete</a> </div> </div>
<script src="vendor/angular.js" type="text/javascript"></script> <script src="scripts/app.js" type="text/javascript"></script> <script src="scripts/hello-world.js" type="text/javascript"></script> </body> </html>
2 Answers
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsYou forgot to add the app.js to your html file.
<script src="scripts/app.js" type="text/javascript"></script>
I hope this help :-)
Jonathan Arbely
6,691 PointsAlright. You can mark this question as solved if you wish. :)
Shreyas Ananth
861 PointsShreyas Ananth
861 PointsHenrik Christensen Check the last but one line.. I have added it.. but still doesnt work..
I found out where the fault was: I had written ngController instead of ng-controller.. MY BAD!