JSFiddle - React, Tailwind, and code Playground

by simpleorchid

HTML

<div ng-app="" ng-controller="personController">

<button ng-click="toggle()">{{display}} user</button>

<p ng-show="myVar">
First Name: <input type=text ng-model="person.firstName"><br>
Last Name: <input type=text ng-model="person.lastName"><br><br>
Full Name: {{person.firstName + " " + person.lastName}}
</p>

</div>

JavaScript

function personController($scope) {
    $scope.person = {
        firstName: "John",
        lastName: "Doe"
    };
    $scope.display = "Hide";
    $scope.myVar = true;
    $scope.toggle = function() {
        $scope.myVar = !$scope.myVar;
        if($scope.myVar){
           $scope.display = "Hide";
        } else {
           $scope.display = "Show"; 
        }
    };
}