我想在 Jquery html 函数中使用 angularJs 字符串插值
$('#existingScoresForWeek').html("<p>{{1 + 1}}</p>");
上面的代码行没有打印 Result as 2
<div data-ng-app="myApp" ng-controller="myCtrl">
<p id="existingScoresForWeek"></p>
<button ng-click="myFunc()">sub</button>
</div>
<script>
var app = angular.module("myApp", ['ngSanitize']);
app.controller("myCtrl", function($scope) {
$scope.myFunc= function(){
ScoreScreenersSave();
};
function ScoreScreenersSave() {
$('#existingScoresForWeek').html("<p>{{1 + 1}}</p>");
}
});
</script>
实际结果:{{1 + 1}} 预期结果:2