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
app = angular.module 'BlogExample', [] | |
# Simple controller that loads all blog posts | |
app.controller 'BlogCtrl', ['$scope', 'Blog', ($scope, Blog) -> | |
# Get all the blog posts | |
Blog.all().then (posts) -> | |
$scope.posts = posts | |
# Extend the $scope with our own properties, all in one big block | |
# I like this because it looks like declaring a class. |