Created
November 8, 2013 11:17
-
-
Save rorlab/7369628 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
<h3 id="title">Blog - AngularJS with Rails API</h3> | |
<div ng-controller="PostsCtrl"> | |
<!--TODO: post 데이터 추가하기--> | |
<div class="row-fluid" style="margin-bottom:1em;"> | |
<fieldset class="span12"> | |
<legend>Post 추가</legend> | |
<label>제목</label> | |
<input type="text" ng-model="addPostData.title"><br/> | |
<label>내용 </label> | |
<textarea ng-model="addPostData.text"></textarea><br/> | |
<a ng-click="addPost()" class="btn btn-primary">Create</a> | |
</fieldset> | |
</div> | |
<div class="row-fluid"> | |
<h3>Post 데이터 목록</h3> | |
<ul id="posts"> | |
<li class="post" ng-show="isPostData()" > | |
<div class="title">{{ addPostData.title }}</div> | |
<div ng-show="addPostData.text" class="text">{{ addPostData.text }}</div> | |
<div class="actions">작성중...</div> | |
</li> | |
<li class="post" ng-repeat="post in posts | orderBy:predicate:reverse "> | |
<div class="title">{{ post.title }}</div> | |
<div class="text">{{ post.text }}</div> | |
<div class="created_at">{{ post.created_at }}</div> | |
<div class="actions"> | |
<a ng-click="editPost(post)"><i class="icon icon-edit"></i> 수정</a> | |
<a ng-click="deletePost(post)"><i class="icon icon-trash"></i> 삭제</a> | |
</div> | |
<!--Show comments of a post--> | |
<div ng-controller="CommentsCtrl"> | |
<div class="comments" ng-show="post.comments"> | |
<div class="comment_label">Comments</div> | |
<ul> | |
<li class="comment" ng-repeat="comment in post.comments"> | |
{{ comment.body }}, <span class="created_at">{{ comment.created_at }}</span> | |
</li> | |
</ul> | |
</div> | |
<div class="row-flow"> | |
<label>Add a Comment</label> | |
<input type="text" ng-Enter="addComment()" ng-model="addCommentData.body" class="span12"> | |
</div> | |
</div> | |
</li> | |
</ul> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment