Skip to content

Commit 3a37b7f

Browse files
committed
연제 1회 공유
0 parents  commit 3a37b7f

1,829 files changed

Lines changed: 226601 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.DS_Store

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
월간 웹 AngularJS 연재 데모 웹 어플리케이션
2+
====
3+
4+
node.js가 설치되어 있으면 다음 명령어를 콘솔에 입력하여 해당 어플리케이션에 필요로하는 node 모듈을 설치한다.
5+
6+
npm install
7+
8+
연재 내용 상 bower를 사용하여 자바스크립트 라이브러리들을 설치하지 않고 필요한 라이브러리들을 libs폴더에 직접 넣어놨다.
9+
10+
본 프로젝트는 grunt.js를 이용하여 테스트용 웹 서버를 실행할 수 있다. 다음 명령어를 콘솔에 입력하여 grunt.js를 설치한다.
11+
12+
npm install -g grunt-cli
13+
14+
간단히 개발 웹 서버를 띄우기 위해서 grunt를 실행한다. 콘솔창에 다음과 같이 입력한다.
15+
16+
grunt
17+

app.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function mainCtrl($scope) {
2+
$scope.userList = [
3+
{ name : '가인', email : 'gain@naver.com', regDate : '2014-06-30' }
4+
];
5+
6+
$scope.insert = function() {
7+
$scope.userList.push({ edit : true });
8+
};
9+
10+
$scope.complete = function (user) {
11+
user.edit = false;
12+
};
13+
14+
$scope.edit = function (user) {
15+
user.edit = true;
16+
};
17+
18+
$scope.del = function (index) {
19+
$scope.userList.splice(index, 1);
20+
}
21+
22+
}

index.html

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!doctype html>
2+
<html ng-app>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>사용자 관리 DEMO APP</title>
6+
<link rel="stylesheet" href="libs/bootstrap/css/bootstrap.min.css">
7+
<link rel="stylesheet" href="resources/app.css">
8+
<script type="text/javascript" src="libs/angular/angular.js"></script>
9+
<script type="text/javascript" src="app.js"></script>
10+
</head>
11+
<body ng-controller="mainCtrl">
12+
<div class="searchBox">
13+
<div class="row-fluid borBox">
14+
<div class='span12'>
15+
<div class='form-horizontal centerOnPage' style="margin-left: -203px;">
16+
<ul class="input-append">
17+
<input type="text" placeholder="이름" size="16">
18+
<button class="btn btn-info box" type="button">
19+
<i class='icon-white icon-search'></i>
20+
</button>
21+
</ul>
22+
<button class="btn btn-info box" type="button" ng-click="insert()">
23+
<i class='icon-white icon-plus'></i>
24+
</button>
25+
</div>
26+
</div>
27+
</div>
28+
</div>
29+
<div class="container-fluid">
30+
<div class="row-fluid">
31+
<div class="span12">
32+
<table class="table table-striped table-hover">
33+
<thead>
34+
<tr>
35+
<th>#</th>
36+
<th>이름</th>
37+
<th>E-Mail</th>
38+
<th>가입 날짜</th>
39+
<th>수정</th>
40+
<th>삭제</th>
41+
</tr>
42+
</thead>
43+
<tbody>
44+
<tr ng-repeat="user in userList">
45+
<td>{{$index + 1}}</td>
46+
<td><input type="text" ng-model="user.name" ng-disabled="!user.edit"></td>
47+
<td><input type="email" ng-model="user.email" ng-disabled="!user.edit"></td>
48+
<td><input type="date" ng-model="user.regDate" ng-disabled="!user.edit"></td>
49+
<td class="center">
50+
<button class="btn btn-danger" type="button" ng-show="!user.edit" ng-click="edit(user)">
51+
<i class='icon-white icon-pencil'></i>
52+
</button>
53+
<button class="btn btn-info" ng-show="user.edit" type="button" ng-click="edit(user)">
54+
<i class='icon-white icon-ok'></i>
55+
</button>
56+
</td>
57+
<td class="center">
58+
<button class="btn btn-danger" type="button" ng-click="del($index)">
59+
<i class='icon-white icon-trash'></i>
60+
</button>
61+
</td>
62+
</tr>
63+
<tr ng-show="!userList.length">
64+
<td colspan="6" style="text-align :center">
65+
<span class="text-warning">데이터가 없습니다.</span>
66+
</td>
67+
</tr>
68+
</tbody>
69+
</table>
70+
{{userList}}
71+
</div>
72+
</div>
73+
</div>
74+
</body>
75+
</html>

0 commit comments

Comments
 (0)