HTML encoding problem

Need to find a way to decode HTML string to plain text.

by Ernesto Rendon

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.0rc3/angular-sanitize.js"></script>
<div ng-app="myApp" ng-controller="LoginController">
     <div class="title">Display Only...</div>
    <hr />    
    <div>Name: {{ user.name }}</div>
    <br />
    <div>Address: {{ user.address }}</div>
    <br /> <br /> <br /> 
    <div class="title">Edit Form</div>
    <hr />
    Name: <input type="text" ng-model="user.name" escape-to-plain-text></input>
    <br /><br />
    Address: <input type="text" ng-model="user.address" escape-to-plain-text></input>
        <br /><br /><br /><br />
    <div class="title">Escaped with ngSanitize</div>
    <hr />
    Address: <span ng-bind-html="sample"></span>
</div>

CSS

input[type="text"] {
    width: 300px;
}

.title {
    font-weight:bold;
}

JavaScript

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

app.controller('LoginController', function ($scope, $sce) {
	// This object is fected from a DB. The data is stored DB this way....
	$scope.user = {
		name : "Kenneth Hinsvark &#38; Maurice McAlister",
		address : "555555 W. Canyon Dr &#35; B212"
	};

	$scope.sample = $sce.trustAsHtml('555555 W. Canyon Dr &#35; B212');
});

app.directive('escapeToPlainText', function () {
    return {
        require: 'ngModel',
		link : function(scope, element, attrs, ngModel) {

			scope.$watch(function(){return ngModel.$modelValue;}, function(newValue, oldValue){
				if (newValue && newValue.length > 0) {
					var hasEncodedHTML = newValue.indexOf("&#") > -1;
					if (hasEncodedHTML){
                        var encodedValue = newValue;
						var decodedValue = decodeHTMLtoPlainText(encodedValue);
						
						ngModel.$setViewValue(decodedValue);
						ngModel.$render();
						console.log(decodedValue);
					}
				}
            }, true);
            

			function decodeHTMLtoPlainText(aValue) {
				var elem = document.createElement('div');
				elem.innerHTML = aValue;
				return elem.childNodes[0].nodeValue;
			}

		}
    }
});