How can I insert my html view into the box? From id test1, into the vm.input variable?
angular.js:13920 Error: [$sce:itype] Attempted to trust a non-string value in a content requiring a string: Context: html
Controller:
vm.showbox = function(name) {
console.log("testing name " + name);
var a = angular.element('#' + name)[0];
console.log(a);
vm.inputbox = $sce.trustAsHtml(a);
console.log(vm.inputbox);
};
view:
<div class"click" ng-click="vm.showbox('test1')">click/div>
<div id="test1" class="ng-hide">
<h3>Shema</h3>
schema here.
</div>
<div style="display: block;" ng-bind-html="vm.inputbox ">
</div>
console log:
<div id="test1" class="ng-hide">
<h3>Shema</h3>
schema here.
</div>
angular.js:13920 Error: [$sce:itype] Attempted to trust a non-string value in a content requiring a string: Context: html