return $sce.trustAsHtml(text.replace(/\\/g, ''));
<div ng-app="app">
<div ng-controller="ExampleController">
<p ng-bind-html="text | trusted"></p>
</div>
</div>
angular.module('app', []).controller('ExampleController', function($scope) {
$scope.text = "A GREAT LOT, THIS IS THE ONE YOU\'VE BEEN LOOKING FOR";
}).filter('trusted', ['$sce', function ($sce) {
return function (text) {
return $sce.trustAsHtml(text); // $sce.trustAsHtml(text.replace(/\\/g, ''));
};
}]);
<form method="post" id="myform">
<input type="text" placeholder="Your name" autofocus required pattern="[a-z]{1,15}"/>
<input type="text" placeholder="Phone-number" required pattern="[0-9]{6,15}"/>
<input type="email" placeholder="Email" required/>
<input class="button" type="button" onclick="sendMyForm();" rel="reg_form" value="request call"/>
</form>
<script type="text/javascript" language="javascript">
function sendMyForm() {
var msg = $('#myform').serialize();
$.ajax({
type: 'POST',
url: 'res.php',
data: msg,
success: function(data) {
$('.popup').fadeIn(500);
$("body").append("<div id='overlay'></div>");
$('#overlay').show().css({'filter' : 'alpha(opacity=80)'});
},
error: function(xhr, str){
alert('Возникла ошибка: ' + xhr.responseCode);
}
});
}
</script>
for(var i=0; i < newTasks.length; i++)
newTasks[i].dateBegin = new Date(Date.parse(newTasks[i].dateBegin));
localStorage.set("tasks", $scope.tasks);
$scope.tasks = localStorage.get("tasks") || tasks;
var btn = document.querySelector(".btn")
isStart = false;
btn.addEventListener("click", function() {
if (isStart) {
btn.classList.remove("modifier");
btn.textContent = "Старт";
isStart = false;
stop();
return;
};
btn.classList.add("modifier");
btn.textContent = "Стоп";
isStart = true;
start();
});
function start() {
console.log("start");
}
function stop() {
console.log("stop");
}
var btn = $('#btn');
btn.on('click',function(){
btn.hasClass('green') ? red(btn) : green(btn);
});
function green(el){
el.removeClass();
el.addClass('green');
}
function red(el){
el.removeClass();
el.addClass('red');
}
$('.green').on('click', function(){
//Some Function
});
$('.red').on('click', function(){
//Some Function
});
<button id='start' value='Start'></button>
let elem = document.querySelector('#start');
elem.addEventListener('click', () => {
elem.value = 'Stop';
elem.backgroundColor = 'red';
});