Skip to content

Commit 6371b8d

Browse files
author
haruhni
committed
소스 코드 업로드
1 parent e144d44 commit 6371b8d

18 files changed

Lines changed: 62131 additions & 1 deletion

document/AngularJS/source/ReadMe.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ booksource : 책에 나온 소스코드 전체
1010
lks : 이기섭 소스코드
1111
Jang.hw :
1212
kimdongil :
13-
Rex :
13+
Rex :
14+
haruhni : 전석환 소스코드
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html ng-app="exampleApp">
3+
<head>
4+
<title>Angular Digest Test</title>
5+
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
6+
<script type="application/javascript" src="angular.js"></script>
7+
<script>
8+
var app = angular.module('exampleApp', []);
9+
10+
app.controller('ctrl', function($scope) {
11+
$scope.text = '';
12+
13+
$scope.angularClick = function() {
14+
$scope.text = 'angular Click';
15+
};
16+
17+
$('#jQueryBtn').on('click', function () {
18+
$scope.text = 'jQuery Click';
19+
20+
// $scope.$apply();
21+
});
22+
});
23+
</script>
24+
</head>
25+
<body>
26+
<div ng-controller="ctrl">
27+
<button ng-click="angularClick();">Angular Click</button>
28+
<button id="jQueryBtn">jQuery Click</button>
29+
30+
text : <span>{{text}}</span>
31+
</div>
32+
</body>
33+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html ng-app="exampleApp">
3+
4+
<head>
5+
<title>Angular Directive</title>
6+
<script type="application/javascript" src="angular.js"></script>
7+
<script>
8+
var app = angular.module('exampleApp', []);
9+
app.directive('helloWorld', function () {
10+
return {
11+
restrict: 'E',
12+
template: '<div>hello world!!</div>',
13+
replace: true
14+
}
15+
});
16+
</script>
17+
</head>
18+
19+
<body>
20+
<hello-world></hello-world>
21+
</body>
22+
23+
</html>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html ng-app="exampleApp">
3+
<head>
4+
<title>Angular iSolate Scope</title>
5+
<script type="application/javascript" src="angular.js"></script>
6+
<script>
7+
var app = angular.module('exampleApp', []);
8+
9+
app.controller('ctrl', function($scope) {
10+
$scope.text = 'scope 1 text';
11+
12+
var childScope = $scope.$new();
13+
console.log('child scope text :: ' + childScope.text);
14+
console.log('$scope === childe.parent ', $scope === childScope.$parent);
15+
16+
var isolateChildScope = $scope.$new(true);
17+
console.log('isolate child scope text :: ' + isolateChildScope.text);
18+
console.log('$scope === isolate childe.parent ', $scope == isolateChildScope.$parent);
19+
});
20+
</script>
21+
</head>
22+
<body>
23+
<div ng-controller="ctrl">
24+
<span>{{text}}</span>
25+
</div>
26+
</body>
27+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html ng-app="exampleApp">
3+
<head>
4+
<title>Angular Scope</title>
5+
<script type="application/javascript" src="angular.js"></script>
6+
<script>
7+
var app = angular.module('exampleApp', []);
8+
9+
app.controller('ctrl1', function($scope) {
10+
$scope.text = 'scope 1 text';
11+
});
12+
13+
app.controller('ctrl2', function($scope) {});
14+
</script>
15+
</head>
16+
<body>
17+
<div ng-controller="ctrl1">
18+
<span>{{text}}</span>
19+
<div ng-controller="ctrl2">
20+
<span>{{text}}</span>
21+
</div>
22+
</div>
23+
</body>
24+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html ng-app="exampleApp">
3+
<head>
4+
<title>Angular Style</title>
5+
<style>
6+
.display-area {
7+
min-height: 100px;
8+
background-color: beige;
9+
margin-top: 20px;
10+
}
11+
</style>
12+
<script type="application/javascript" src="angular.js"></script>
13+
<script>
14+
angular.module('exampleApp', []);
15+
</script>
16+
</head>
17+
<body>
18+
Text: <input type="text" ng-model="val">
19+
20+
<div class="display-area">
21+
<span>{{val}}</span>
22+
</div>
23+
</body>
24+
</html>

0 commit comments

Comments
 (0)