Skip to content

Instantly share code, notes, and snippets.

@khoand0000
Last active August 29, 2015 14:25
Show Gist options
  • Save khoand0000/d305a084e538feacdb96 to your computer and use it in GitHub Desktop.
Save khoand0000/d305a084e538feacdb96 to your computer and use it in GitHub Desktop.
$ionicModal: fromTemplate vs. fromTemplateUrl functions

To get object ionicModal:

  • fromTemplate()
var template='<ion-modal-view>
    <ion-header-bar><h1 class="title">title</h1></ion-header-bar>
    <ion-content>content</ion-content>
</ion-modal-view>';
$scope.modal = $ionicModal.fromTemplate('templates/code-modal.html', {
    scope: $scope,
    animation: 'slide-in-up'
});
  • fromTemplateUrl()
$ionicModal.fromTemplateUrl('templates/code-modal.html', {
    scope: $scope,
    animation: 'slide-in-up'
}).then(function(modal) {
    $scope.modal = modal;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment