Skip to content

Passing variables to patterfly-notification-drawer triggers infinite loop #419

Closed

Description

@benjaminapetersen

If I pass the template includes via $scope variables like this:

          angular.extend($scope, {
            notificationGroups: [{
              heading: 'Tab 1',
              subHeading: 'woohoo!',
              notifications: [{
                unread: true,
                message: 'Hello world'
              }]
            }],
            headingInclude: 'views/directives/notifications/heading.html',
            subheadingInclude: 'views/directives/notifications/subheading.html',
            notificationBodyInclude: 'views/directives/notifications/notification-body.html',
            notificationFooterInclude: 'views/directives/notifications/notification-footer.html',
            customScope: {}
          });
  <div
    pf-notification-drawer
    heading-include="headingInclude"
    subheading-include="subheadingInclude"
    notification-body-include="notificationBodyInclude"
    notification-footer-include="notificationFooterInclude"
    custom-scope="customScope">
  </div>

My console logs some pretty gnarly things:

screen shot 2017-02-16 at 5 00 39 pm

And the chrome-helper process associated with this page very quickly consumes over 1GB of memory (this is when I force quite, it seems to climb indefinitely).

Activity

  1. jeff-phillips-18 commented on Feb 16, 2017

    @jeff-phillips-18
    Member

    The includes are expected to be attributes, I believe you need to use heading-include=“{{headingInclude}}” .

    Not saying it is OK to infinite loop on error but does this fix your particular issue?

  2. benjaminapetersen commented on Feb 17, 2017

    @benjaminapetersen
    MemberAuthor

    Ah, yeah that was a dumb mistake on my part, getting the binding right fixes.

    As far as that loop error goes, I'm guessing that it attempted to make an $http request for the template on the string headingInclude which fails and probably returns index.html. The directive is likely trying to put index.html into the page, which reloads angular & triggers the whole cycle again.

  3. jeff-phillips-18 commented on Feb 17, 2017

    @jeff-phillips-18
    Member

    Great. Should we close this then? I'm not sure we could fix this in the drawer code unless we were to expect variables instead and that would be a breaking change.

  4. benjaminapetersen commented on Feb 17, 2017

    @benjaminapetersen
    MemberAuthor

    I'm fishing around a bit to see if this is a common problem with using includes, or if there is a good way to check against it.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions