-
-
Save codecademydev/6dec291e181db464d13a115d803828c5 to your computer and use it in GitHub Desktop.
Codecademy export
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
var app = angular.module('FeedsterApp', []); |
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
<img class="avatar" ng-src="{{ post.author.avatar }}"> | |
<h3 class="author-name">{{ post.author.name }}</h3> | |
<p class="comment-text">{ post.comment.text }}</p> | |
<img class="comment-img" ng-src="{{ post.comment.img }}"> | |
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.directive('feedsterPost', function() { | |
return { | |
restrict: 'E', | |
scope: { | |
post: '=' | |
}, | |
templateURL: 'js/directives/feedsterPost.html' | |
}; | |
}); | |
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
<!doctype html> | |
<html> | |
<head> | |
<link href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet"> | |
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700" rel="stylesheet" type="text/css"> | |
<link href="css/main.css" rel="stylesheet"> | |
<script src="js/vendor/angular.min.js"></script> | |
</head> | |
<body ng-app="FeedsterApp"> | |
<div class="header"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-2"> | |
<h1>feedster</h1> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="posts" ng-controller="PostController"> | |
<div class="container"> | |
<div class="post" ng-repeat="post in posts"> | |
<feedster-post post="post"></feedster-post> | |
</div> | |
</div> | |
</div> | |
<!-- Modules --> | |
<script src="js/app.js"></script> | |
<!-- Controllers --> | |
<script src="js/controllers/PostController.js"></script> | |
<!-- Directives --> | |
<script src="js/directives/feedsterPost.js"></script> | |
</body> | |
</html> |
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.controller('PostController', ['$scope', function($scope) { | |
$scope.posts = [ | |
{ | |
author: { | |
name: 'Calvin Broadus, Jr.', | |
avatar: 'img/cbj.svg' | |
}, | |
comment: { | |
img: 'img/dog.jpg', | |
text: 'How much for that dogg in the window?' | |
} | |
}, | |
{ | |
author: { | |
name: 'Matthew Healy', | |
avatar: 'img/mh.svg' | |
}, | |
comment: { | |
text: 'I used to have a recurring dream when I was younger.' | |
} | |
} | |
]; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment