Cannot read property 'substr' of null at onsenui.js.



  • Cannot read property ‘substr’ of null at onsenui.js. How to resolve this error
    i am showing a ons dialog within another dialog


  • Onsen UI

    @Shubham-Kaushik Can you show your log, code or something? It’s hard to debug with only that info.



  • onsenui.js:5847 Uncaught TypeError: Cannot read property 'substr' of null
        at onsenui.js:5847
        at HTMLElement.<anonymous> (onsenui.js:5849)
        at HTMLElement.eventHandler (angular.js:3296)
        at Object.fireComponentEvent (onsenui.js:21196)
        at post (onsenui.js:15767)
        at invokeLinkFn (angular.js:8780)
        at nodeLinkFn (angular.js:8280)
        at delayedNodeLinkFn (angular.js:8528)
        at compositeLinkFn (angular.js:7671)
        at nodeLinkFn (angular.js:8275)
    


  • <ons-page>
    
    
        <ons-dialog style="background:#fff;  overflow:auto; border-radius:4px;min-width: 98%!important" var="feedback" animation="none" mask-color="rgba(0, 0, 0, 0.4)" ng-init="notify()" cancelable ng-controller="HomeCtrl">
    
    
            <ons-icon size="40px" icon="ion-ios-close-empty" class="crossicon" ng-click="hidefeedbackDialog()"></ons-icon>
    
            <div ng-show="showStars">
    
    
                <ons-row>
    
                    <ons-col ng-repeat="rating in ratings">
    
                        <div star-rating rating-value="rating.current" max="rating.max" on-rating-selected="getSelectedRating(rating)">
                        </div>
                    </ons-col>
                </ons-row>
            </div>
    
            <div class="main_feedback">
    
                <div ng-show="showMe">
                    <ons-toolbar class="toolbar_clr">
                        <div class="right">
                            <ons-icon size="40px" icon="ion-ios-close-empty" style="color:white" class="crossicon" ng-click="hidefeedbackDialog()"></ons-icon>
    
                        </div>
                        <div class="center">
                            <span style="color:white">{{currentLocale.feedback}}</span>
                        </div>
                    </ons-toolbar>
    
                    <ons-row>
                        <ons-col ng-repeat="rating in ratings">
    
                            <div star-rating rating-value="rating.current" max="rating.max" style="margin: 38px 0 0 0;" on-rating-selected="getSelectedRating(rating)">
                            </div>
                        </ons-col>
                    </ons-row>
                    <div id="rcorners1">
    
    
                        <ul class="feedMessage" ng-repeat="x in myData | orderBy:'DateDisplayed'">
                            <li class="messagebox" ng-show="x.IsAdmin==false">
                                <p class="msgg">  {{ x.Message}} </p>
                                <p class="date"> {{x.DateDisplayed }}</p>
    
                            <li class="messagebox1" ng-show="x.IsAdmin==true">
                                <p class="msgg">  {{ x.Message}} </p>
                                <p class="date"> {{x.DateDisplayed }}</p>
    
    
    
    
                        </ul>
    
                     
    
    
                    </div>
    
    
    
                    <div class="msg ">
                        {{currentLocale.feedMessage}}!.
    
                    </div>
    
                    <ul class="asFedback">
                        <li>
                            <textarea placeholder="Add Your Feedback" ng-model="feedback.text"></textarea>
                            <img src="images/send.png" class="sendimage" ng-click="send_feedback(feedback)">
    
    
                        </li>
    
                    </ul>
    
                        <ons-dialog var="dialog" animation="none" mask-color="rgba(0, 0, 0, 0.4)" ng-controller="HomeCtrl">
                            <div style="text-align: center; padding: 5px;">
    
                                <p style="color:#125073;margin:3px">
                                    Redirecting to Play Store.
                                <p align="center" style="margin:3px"> <ons-icon icon="ion-load-c" size="25px" spin="true" style="margin-top:5px"></ons-icon></p>
                                <ons-icon size="30px" spin icon="md-spinner"></ons-icon>
    
                                <button type="button" class="fedokButton" ng-click="click('Rate Us');closeDialog()">{{currentLocale.ok}}</button>
    
                                <button type="button" class="fedcancelButton" ng-click="stopTimer()">{{currentLocale.no}}</button>
                            </div>
    
                        </ons-dialog>
    
    </div>
            </div>
        </ons-dialog>
    
    </ons-page>
    

  • Onsen UI

    @Shubham-Kaushik
    It seems that you are using onsenui@1.3.17, but Onsen UI 1 is no longer supported.
    Could you consider using Onsen UI 2?



  • Can anyone help me to solve this issue?



  • @Shubham-Kaushik Most of us in the community only use v2 now because v1 is no longer supported. It looks like you have an issue between angular and onsen. You will have to start digging into Onsen v1 itself. It would be easiest, honestly, to just migrate to v2. Here are the docs to get that started: https://onsen.io/v2/docs/guide/angular1/from-v1-to-v2.html



  • How can I access background when using ons-modal.
    Any suuggestions?


Log in to reply