JSFiddle - React, Tailwind, and code Playground

HTML

<div id="settingsholder"  ng-controller="MyCtrl">
      <input ng-model="user.firstName" ng-init="user.firstName=''" />
      <input ng-model="user.lastName" ng-init="user.lastName=''"/>
      <input type="button" ng-click="showJsonF()" value="Object To JSON" />
        <hr/>  
        {{user | json}}
    </div>

JavaScript

function MyCtrl($scope) {

    alert(JSON.stringfy($scope.user));
    $scope.showJsonF()= function () {
        alert(JSON.stringfy($scope.user));
    }
}