Skip to content

componentHandler.upgradeAllRegistered() on ngView #4

@Piou2fois

Description

@Piou2fois

Hi
I am facing an issue using MDL with Angularjs in the ngView
For example on Textfields, the ripple.js is launched before the end of the ng-repeat process into the ngView. It is recommended to launch the function componentHandler.upgradeAllRegistered() when all is finished on dynamic websites but can't find anyway for that.
Best way seems to have a directive linked to the "$last" of ngRepeat elements :

.directive('onFinishRender', function() {
  return {
    restrict: 'A',
    link: function(scope, element, attr) {
      if (scope.$last === true) {
        element.ready(function() {
          componentHandler.upgradeAllRegistered()
        });
      }
    }
  }

Perhaps you can add this directive in all the MDL directives ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions