Created
September 5, 2014 12:09
-
-
Save sivaprasadreddy/306a9c2b79ad1f6a48ec to your computer and use it in GitHub Desktop.
TodoController-v1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myApp.controller('TodoController',['$scope','$http',function($scope,$http){ | |
var todoCtrl = this; | |
todoCtrl.todos = []; | |
todoCtrl.loadTodos = function(){ | |
$http.get('/todos.json').success(function(data){ | |
todoCtrl.todos = data; | |
}).error(function(){ | |
alert('Error in loading Todos'); | |
}); | |
}; | |
todoCtrl.loadTodos(); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment