How To Add Html Code Dynamically To Ion-content?
I'm working with ionic cross platform and I want to add dynamically a html code inside ion-content and thank you.
Solution 1:
<ion-view view-title="Admin-DashBoard">
<ion-nav-bar class="bar bar-header header-all">
<ion-nav-buttons side="left">
</ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<div class="some css">
<div class="some css" ng-include="newPage.url"> </div>
</div>
</div>
</ion-content>
$scope.ratingView = [{
name: 'templates/zzz/zzzz-ratings.html',
url: 'templates/zzz/zzzz-ratings.html'
}];
$scope.newPage = $scope.ratingView[0];
Above code that show , you create add dynamically html page , if you want add html from controller side simply create controller side template with javaScript.
Solution 2:
Take a look to ng-bind-html, you must include safe html
Post a Comment for "How To Add Html Code Dynamically To Ion-content?"