2016년 1월 10일 일요일

[AngularJS] ng-model


http://colorscripter.com/
에가서 code를 입력하고, 복사하면 아래와 같이 붙여 넣을 수 있다.

ng-model을 사용하면, model의 name 데이터를 변경할 수 있다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<html>
<head>  
</head>
<body ng-app>
   <h1>{{name}}</h1>
   <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
  
  <input type="text" ng-model="name">
  <input type="text" value="{{name}}">
  
</body>
</html>
cs

플링크를 이용하면, code를 직접 테스트 할 수 있다.
http://embed.plnkr.co/PR190fAdWEdxlf8F3wyD/

{{name}}

댓글 없음:

댓글 쓰기