AngularJS

JAVA/AngularJS 2016. 1. 28. 14:09

<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



블로그 이미지

왕왕왕왕

,