如何利用angular2双向数据绑定,绑定一个对象数组中的数据
2个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
{{ firstName + " " + lastName }}
</div>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
</script>
</body>
</html>
只能给你举个例子 还是需要你自己学习的
<html>
<head>
<meta charset="utf-8">
<script src="
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
{{ firstName + " " + lastName }}
</div>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
</script>
</body>
</html>
只能给你举个例子 还是需要你自己学习的
引用草原上之狼的回答:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
{{ firstName + " " + lastName }}
</div>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
</script>
</body>
</html>
只能给你举个例子 还是需要你自己学习的
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
{{ firstName + " " + lastName }}
</div>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
</script>
</body>
</html>
只能给你举个例子 还是需要你自己学习的
展开全部
人家问的是angular2 ,你答个angular1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询