angular js模塊,angular js控制器
阿新 • • 發佈:2017-05-05
bsp ket tro bracket mod [] var angular function
姓名: {{firstName + " " + lastName}} </div>
<script>
var app = angular.module(‘myApp‘, []);
app.controller(‘myCtrl‘, function($scope)
{ $scope.firstName= "John"; $scope.lastName= "Doe"; });
</script>
AngularJS 模塊
var app = angular.module(‘myApp‘, []);AngularJS 控制器
app.controller(‘myCtrl‘, function($scope) { $scope.firstName= "John"; $scope.lastName= "Doe"; });AngularJS 實例
<div ng-app="myApp" ng-controller="myCtrl"> 名: <input type="text" ng-model="firstName"><br> 姓: <input type="text" ng-model="lastName"><br> <br>angular js模塊,angular js控制器