溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

angularjs控制器方法

發(fā)布時間:2020-06-30 12:34:23 來源:網絡 閱讀:246 作者:素顏豬 欄目:開發(fā)技術

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title></title>

<link rel="stylesheet" href="">

</head>

<body>

<div ng-app="myApp" ng-controller="myCtrl">

名:<input type="text" ng-model="firstName"><br/>

姓:<input type="text" ng-model="lastName"><br/>

<br/>

姓名:{{fullName()}}

</div>

</body>

<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>

<script>

var app = angular.module("myApp",[]);

app.controller('myCtrl',function($scope){

$scope.firstName = "John";

$scope.lastName = "Doe";

$scope.fullName = function(){

return $scope.firstName + " " + $scope.lastName;

}

});

</script>

</html>

angularjs控制器方法

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI