Wissem Achour Wissem Achour - 3 months ago 21
Javascript Question

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.

Answer
<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.