@alexvainio wrote:
Hello,
I’ve been trying to insert a modal into my Creator v1 project for hours. I’ve tried various examples, including pure JS/CSS modals and using IonicModal. It just doesn’t work - the result is either a white screen or the button does nothing. I’m using HTML pages.This is one example I tried (can be found here). It would probably work, but my Creator doesn’t understand
<ion-modal-view>
, at least judging by the colour. Here’s the code:<script id="my-modal.html" type="text/ng-template"> <ion-modal-view> <ion-header-bar> <h1 class="title">My Modal title</h1> </ion-header-bar> <ion-content> Hello! </ion-content> </ion-modal-view> </script> angular.module('testApp', ['ionic']) .controller('MyController', function($scope, $ionicModal) { $ionicModal.fromTemplateUrl('my-modal.html', { scope: $scope, animation: 'slide-in-up' }).then(function(modal) { $scope.modal = modal; }); $scope.openModal = function() { $scope.modal.show(); }; $scope.closeModal = function() { $scope.modal.hide(); }; // Cleanup the modal when we are done with it! $scope.$on('$destroy', function() { $scope.modal.remove(); }); // Execute action on hide modal $scope.$on('modal.hidden', function() { // Execute action }); // Execute action on remove modal $scope.$on('modal.removed', function() { // Execute action }); });
These didn’t work either: www.w3schools.com / Modal boxes
There’s obviously something I’m doing wrong. Any ideas? I’m happy to provide more information, should it be needed.
Help would be greatly appreciated!
Posts: 1
Participants: 1