zamena.replaceWith('<input type="text" ng-model="name" id="inputNewName" autofocus>');
$('#inputNewName').after('<p id="trash" class="ng-binding">{{name}}</p>');
var elem1 = zamena.replaceWith('<input type="text" ng-model="name" id="inputNewName" autofocus>');
var elem2 = $('#inputNewName').after('<p id="trash" class="ng-binding">{{name}}</p>');
$compile(elem1)($scope);
$compile(elem2)($scope);