Skip to content Skip to sidebar Skip to footer

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-viewview-title="Admin-DashBoard"><ion-nav-barclass="bar bar-header header-all"><ion-nav-buttonsside="left"></ion-nav-buttons></ion-nav-bar><ion-content><divclass="some css"><divclass="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?"