[SOLVED] IonicModal Attempted to assign to readonly property

Hi, I’m developing an app that uses pop-ups. To create them using this code:

 $ionicModal.fromTemplateUrl("./templates/modal/searchArticolo.html", {
            scope: $scope,
            animation: 'slide-in-up'
        }).then(function(modal) {
            $scope.dOrd.modal = modal;
            $scope.openModal();
        });
        $scope.openModal = function() {
            $scope.dOrd.modal.show();
        };
        $scope.closeModal = function() {
            $scope.dOrd.modal.remove();
        };

The problem is that if I try to open the pop-up a second time, I get this error:

68    989391   error    Error: Attempted to assign to readonly property.
ChildScope@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:21460:44
$new@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:21468:40
createModal@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:43940:52
http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:44003:32
processQueue@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:20962:29
http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:20978:39
$eval@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:22179:28
$digest@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:21995:36
$apply@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:22283:31
http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:50863:19
eventHandler@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:10823:25
dispatchEvent@[native code]
triggerMouseEvent@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:2811:20
tapClick@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:2800:20
tapTouchEnd@http://192.168.1.19:8100/lib/ionic/js/ionic.bundle.js:2918:13

I saw that the line “21460: 44” file js ionic.bundle.js, is in this function:

this.$$ChildScope = function ChildScope() {
            this.$$watchers = this.$$nextSibling =
                this.$$childHead = this.$$childTail = null;
          this.$$listeners = {};
          this.$$listenerCount = {};

Can anyone help me please?
I’m stuck in this point :frowning:

Thanks!

Matteo

I’ve resolved in this way: https://github.com/angular/angular.js/issues/9128.
Replaced the function in /lib/ionic/js/ionic.bundle.js, now works.

I hope in an future update :wink:
Please close.

Thanks.

@Raystorm7, what exactly did you change?

Follow the instructions in here https://gist.github.com/jhunken/767cdf62ecc9f31c56da

In short:

bower install https://gist.github.com/beckyconning/9fe5450046cabfa5d104.git --save

Then include it in your index.html.

<script src="lib/angular-issue-9128-patch/angular-issue-9128-patch.js"></script>

And finally don’t forget to inject it in your module.

var myApp = angular.module('myApp', ['issue-9128-patch'])

It worked for me!
Cheers

1 Like