Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // public/core.js
- var scotchTodo = angular.module('scotchTodo', []);
- function mainController($scope, $http) {
- $scope.formData = {};
- // when landing on the page, get all todos and show them
- $http.get('/api/todos')
- .success(function(data) {
- $scope.todos = data;
- console.log(data);
- })
- .error(function(data) {
- console.log('Error: ' + data);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement