angular ng-show / ng-hide not working correctly with ng-bind-html
问题 I want to set ng-show or ng-hide for my elements in html string and pass it to view with ng-bind-html but ng-show / ng-hide not working and my element always visible. This is my controller code: $scope.my = { messageTrue: true, messageFalse: false }; $scope.HtmlContent = "<div ng-show='{{my.messageFalse}}'>This is incorrect (ng-show & my.messageFalse={{my.messageFalse}})</div> "; $scope.trustedHtml = $interpolate($scope.HtmlContent)($scope); And this is my view code: <div ng-show="my