Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bindonceController.runBinders is not a function #129

Open
jeffward01 opened this issue May 9, 2016 · 2 comments
Open

bindonceController.runBinders is not a function #129

jeffward01 opened this issue May 9, 2016 · 2 comments

Comments

@jeffward01
Copy link

I am testing this library to speed up my large Angular 1.3.5 application. I installed Bindonce and was able to get it to run, now when the page loads (it does load) i get many errors in the console. All of the errors say:

TypeError: bindonceController.runBinders is not a function
at bindonceDirective.link (http://spa.local/scripts/bindonce.js:225:26)
at invokeLinkFn (http://spa.local/scripts/angular.js:8141:9)
at nodeLinkFn (http://spa.local/scripts/angular.js:7653:11)
at compositeLinkFn (http://spa.local/scripts/angular.js:7009:13)
at publicLinkFn (http://spa.local/scripts/angular.js:6888:30)
at boundTranscludeFn (http://spa.local/scripts/angular.js:7027:16)
at controllersBoundTransclude (http://spa.local/scripts/angular.js:7680:18)
at ngRepeatAction (http://spa.local/scripts/angular.js:24406:15)
at Object.$watchCollectionAction as fn
at Scope.$digest (http://spa.local/scripts/angular.js:14133:29)

Please advise? Thanks! And thanks for writing this library, i am telling all my friends about it.

@jeffward01
Copy link
Author

I read this on your docs:

when used with ng-repeat bindonce doesn't need to check if person is defined because ng-repeat creates the directives only when person exists. You could be more explicit:

  • , however assigning a value to bindonce in an ng-repeat won't make any difference.

    So I dont think i am making a mistake by doing this:

    <tbody bindonce ng-repeat="licenseNote in licenseDetail.licenseNoteList">
                    <tr>
                        <td securityreadonlyhide class="one-percent centered"><input type="checkbox" ng-model="licenseNote.selected" bindonce bo-if="licenseNote.displayNote" /></td>
                        <td class="eight-percent">{{licenseNote.createdDate | timezone | date:'MM/dd/yyyy' }}</td>
                        <td class="eight-percent">{{licenseNote.noteType.noteType}}</td>
                        <td class="eight-percent">{{licenseNote.contact.fullName}}</td>
                        <td class="seventyfive-percent" style="white-space: pre-wrap;">{{licenseNote.note }}</td>
    
                    </tr>
    

    instead of this:

    <tbody bindonce="licenseDetail.licenseNoteList" ng-repeat="licenseNote in licenseDetail.licenseNoteList">
                    <tr>
                        <td securityreadonlyhide class="one-percent centered"><input type="checkbox" ng-model="licenseNote.selected" bindonce bo-if="licenseNote.displayNote" /></td>
                        <td class="eight-percent">{{licenseNote.createdDate | timezone | date:'MM/dd/yyyy' }}</td>
                        <td class="eight-percent">{{licenseNote.noteType.noteType}}</td>
                        <td class="eight-percent">{{licenseNote.contact.fullName}}</td>
                        <td class="seventyfive-percent" style="white-space: pre-wrap;">{{licenseNote.note }}</td>
    
                    </tr>
    

    ****Difference ^^^ (bindonce="licenseDetail.licenseNoteList) ^^^

  • @jeffward01
    Copy link
    Author

    I also get this error:

    TypeError: bindonceController.setupWatcher is not a function
    at bindonceDirective.link (http://spa.local/scripts/bindonce.js:230:25)
    at invokeLinkFn (http://spa.local/scripts/angular.js:8141:9)
    at nodeLinkFn (http://spa.local/scripts/angular.js:7653:11)
    at compositeLinkFn (http://spa.local/scripts/angular.js:7009:13)
    at compositeLinkFn (http://spa.local/scripts/angular.js:7012:13)
    at compositeLinkFn (http://spa.local/scripts/angular.js:7012:13)
    at compositeLinkFn (http://spa.local/scripts/angular.js:7012:13)
    at publicLinkFn (http://spa.local/scripts/angular.js:6888:30)
    at http://spa.local/scripts/angular-ui-router.min.js:7:22101
    at invokeLinkFn (http://spa.local/scripts/angular.js:8141:9)

    Example:

       <div bindonce="config">
                        <tr ng-repeat="config in productDetail.configurations">
                            <td>
                                <span class="icon config-physical" ng-class="config.configuration.id | returnConfigurationIcon"></span>{{config.configuration.name}}
                            </td>
                            <td> {{config.upc}}</td>
                            <!--<td class="twenty-percent">{{config.record_number}}</td>-->
    
                            <td class="centered">{{config.releaseDate | timezone | date:'MM/dd/yyyy'}}</td>
                        </tr>
                    </div>
    

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant