•<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body style="direction:rtl">
<div ng-app="myApp" ng-controller="personCtrl">
<button ng-click="toggle()">کاربر را پنهان کن</button>
<p ng-show="myVar">
نام: <input type=text ng-model="person.firstName"><br>
نام خانوادگی: <input type=text ng-model="person.lastName"><br><br>
نام کامل: {{person.firstName + " " + person.lastName}}
</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('personCtrl', function($scope) {
$scope.person = {
firstName: "John",
lastName: "Doe"
};
$scope.myVar = true;
$scope.toggle = function() {
$scope.myVar = !$scope.myVar;
};
});
</script>
</body>
</html>