<div ng-app="myApp" ng-controller="myCtrl">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName= "John";
$scope.lastName= "Doe";
});
</script>
Module
var app = angular.module('myApp', []);
Controller
app.controller('myCtrl', function($scope) {
$scope.firstName= "John";
$scope.lastName= "Doe";
});
출력 First Name : John
Last Name : Doe
Full Name : John Doe
'JAVA > AngularJS' 카테고리의 다른 글
AngularJS ng-init를 이용한 여러가지 초기화방법 (0) | 2016.01.28 |
---|---|
AngularJS 흔히 알고있는 Print와 같은 {{}} (0) | 2016.01.28 |
AngularJS 변수초기화해주는 NG-INIT (0) | 2016.01.28 |
AngularJS 시작 (0) | 2016.01.28 |