AngularJS 튜토리얼 - Hello 예제 2

Jmnote (토론 | 기여)님의 2015년 6월 20일 (토) 17:13 판 (→‎개요)

1 개요

AngularJS 튜토리얼 - Hello 예제 2
  • ng-init을 통해 yourName 변수에 값을 할당함
  • {{yourName}} 자리에 변수의 값을 보여줌
AngularJS가 가진 템플릿 엔진 기능

2 hello2.html

<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
</head>
<body ng-app ng-init="yourName='친구들'">

<h1>안녕 {{yourName}}!</h1>

</body>
</html>

3 테스트

4 같이 보기

5 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}