Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

An md-subheader with ng-if throws an exception #2650

Closed
ddimitrop opened this issue Apr 30, 2015 · 3 comments
Closed

An md-subheader with ng-if throws an exception #2650

ddimitrop opened this issue Apr 30, 2015 · 3 comments
Assignees
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Milestone

Comments

@ddimitrop
Copy link

http://codepen.io/anon/pen/aOOyMx

Code:

<md-list>
      <md-subheader ng-if="true" >
        test
      </md-subheader>
</md-list>

throws:

TypeError: e[0].querySelector is not a function
    at d (https://material.angularjs.org/docs.js:3:16194)
    at https://material.angularjs.org/docs.js:3:16352
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:51:108
    at MdSubheaderDirective.compile (https://material.angularjs.org/docs.js:3:16300)
    at Z (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:70:356)
    at J (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:59:484)
    at g (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:52:9)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:51:118
    at $get.l (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:52:497)
    at k (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:57:62) <h2 class="md-subheader ng-scope md-default-theme" ng-if="true">
@ddimitrop
Copy link
Author

return angular.element(el[0].querySelector('.md-subheader-content'));

@ThomasBurleson ThomasBurleson added this to the 0.10.0 milestone Apr 30, 2015
@dmackerman
Copy link

Can confirm this. Was wondering where that error was coming from! 👍

@ThomasBurleson ThomasBurleson modified the milestones: 0.10.0, 0.11.0 Jun 16, 2015
@topherfangio
Copy link
Contributor

Confirmed in latest 0.10.1 release. Will fix.

@topherfangio topherfangio added the pr: merge ready This PR is ready for a caretaker to review label Aug 14, 2015
topherfangio added a commit that referenced this issue Aug 15, 2015
topherfangio added a commit that referenced this issue Aug 18, 2015
…nd ng-repeat.

When used with `ng-if` or `ng-repeat`, the `md-subheader` was not able to properly
clone itself when creating a sticky because it only had a comment tag. Delay
initialization until after the `ng-if`/`ng-repeat` has finished before attempting
to create the clone.

fixes #2650, fixes #2980
kennethcachia pushed a commit to kennethcachia/material that referenced this issue Sep 23, 2015
…nd ng-repeat.

When used with `ng-if` or `ng-repeat`, the `md-subheader` was not able to properly
clone itself when creating a sticky because it only had a comment tag. Delay
initialization until after the `ng-if`/`ng-repeat` has finished before attempting
to create the clone.

fixes angular#2650. fixes angular#2980. closes angular#4171.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants