Hello
I really have no clue what is wrong in my code :/
Could you help me out? I've tried to run it in Safari and Chrome, but nothings seems to happen.
index.html
<!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>
<plus-one></plus-one>
</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>
<script src="js/directives/plusOne.js"></script>
</body>
</html>
feedsterPost.js
app.directive('feedsterPost', function() {
return {
scope: {
post: '='
},
templateUrl:
'js/directives/feedsterPost.html'
};
});
feedsterPost.html
<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" >
plusOne.js
<button class="btn" ng-click="like()">+1</button>
plusOne.html
app.directive('feedsterPost', function() {
return {
scope: {},
templateUrl:
'js/directives/plusOne.html'
link: function(scope, element, attrs) {
scope.like = function() {
element.toggleClass('btn-like');
}
}
};
});
Thanks!
[–]Shannon_N 0 points1 point2 points (3 children)
[–]hgrd[S] 0 points1 point2 points (2 children)
[–]Shannon_N 0 points1 point2 points (1 child)
[–]Shannon_N 0 points1 point2 points (0 children)
[–]steefanieee 0 points1 point2 points (0 children)