Skip to content

TypeError: Cannot read property '$$phase' of null #33

Description

@tlenex

This error is called on this line:

          $element
            .on('dp.change', function (e) {
              if (ngModelCtrl) {
                $timeout(function () {
                  ngModelCtrl.$setViewValue(e.target.value); // TypeError: Cannot read property '$$phase' of null
                });
              }
            })
            .datetimepicker(options);

I think $setViewValue should be wrapped in something like this:

  $scope.$applyAsync(function() {
    ngModelCtrl.$setViewValue(e.target.value);
  });

and if should remove listeners by $element.off with the event handler on $scope.$on('$destroy', ...)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions