Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Bug: ng-model-options not working  #252

@shyamal890

Description

@shyamal890

For some reason when I utilize ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 5000, 'blur': 0 } }" . Default delay of 5000 is working alright. However, onBlur doesn't trigger model update.

Example Plunker

Request: Please add version number in the tinymce.js file.

Activity

deeg

deeg commented on May 11, 2016

@deeg
Contributor

I am not sure we are set up to work with ng-model-options. I am open to supporting this if you want to put out a PR.

I will open a ticket and look into adding a version number to the tinymce.js file.

shyamal890

shyamal890 commented on May 24, 2016

@shyamal890
Author

@deeg I have no idea how this can be supported. however, there is something that I noticed, changes in debounce value are taken in to consideration where as blur is not.

shyamal890

shyamal890 commented on Jun 21, 2016

@shyamal890
Author

@deeg Made some changes to js file for custom debounce and blur option. Would like your take whether they are good enough as a temporary solution?

Changes:
Added debouncetime and onblur to options.

//Debounce update and save action
        var debouncedUpdate = (function(debouncedUpdateDelay) {
          var debouncedUpdateTimer;
          return function(ed) {
            $timeout.cancel(debouncedUpdateTimer);
             debouncedUpdateTimer = $timeout(function() {
              return (function(ed) {
                if (ed.isDirty()) {
                  ed.save();
                  updateView(ed);
                }
              })(ed);
            }, options.debouncetime);   //CHANGED
          };
        })(400);   

ed.on('blur', function() {
              element[0].blur();
              ngModel.$setTouched();
              if (!$rootScope.$$phase) {
                scope.$digest();
              }
              if(options.onblur){
                updateView(ed);   //CHANGED
              }
            });

PLUNKER

SiriusED

SiriusED commented on May 10, 2018

@SiriusED

Is this issue fixed or still opened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @deeg@shyamal890@SiriusED

        Issue actions

          Bug: ng-model-options not working · Issue #252 · angular-ui/ui-tinymce