I'm trying to pass a variable from an Angular scope function, such that the HTML contents of a TinyMCE textarea are rendered in an ng-bind-html . Unsure why the following functions are still getting $sce.unsafe error
rootScope
app.run(function($rootScope, $http, $sce, $compile) {
// Text Parsing
$rootScope.txtRefresh = function(obj) {
obj = $sce.trustAsHtml(obj);
};
});
Controller
$scope.txtRefresh = function (obj) {
$rootScope.txtRefresh(obj);
}
Partial
<label>Paragraph 1</label>
<textarea data-ui-tinymce ng-change="txtRefresh(field['txt-1'])" type="text" class="form-control" ng-model="field['txt-1']" rows="4" placeholder="Description..." />
<div ng-bind-html="field['txt-1']"></div>
|