Created
May 12, 2014 21:44
-
-
Save forabi/9d8ee870a0aa38345525 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "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 |
This file contains hidden or 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
| 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") |
This file contains hidden or 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
| 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