Skip to content

Instantly share code, notes, and snippets.

@forabi
Created May 12, 2014 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forabi/9d8ee870a0aa38345525 to your computer and use it in GitHub Desktop.
Save forabi/9d8ee870a0aa38345525 to your computer and use it in GitHub Desktop.
app = angular.module "ng-blog", []
app.controller 'HomeCtrl', ($http, $scope) ->
$scope.posts = [
(
title: "Hello world!",
excerpt: "A simple Hello World!"
)
(
title: "Hello world!",
excerpt: "A simple Hello World!"
)
]
console.log $scope.posts
doctype html
html(ng-app="ng-blog")
head
meta(charset="utf-8")
title Blog
body
blog(ng-controller="HomeCtrl")
post(ng-repeat="post in posts")
h2 {{ post.title }}
{{ post.excerpt }}
script(src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular.min.js")
body {
display: flex;
justify-content: center;
}
blog {
display: flex;
flex-direction: column;
width: 70%;
post {
border-bottom: 1px black dashed;
h2 {
color: red;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment