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

Cannot read property '$attrs' of undefined #2613

Closed
dmackerman opened this issue Apr 29, 2015 · 11 comments
Closed

Cannot read property '$attrs' of undefined #2613

dmackerman opened this issue Apr 29, 2015 · 11 comments
Assignees
Milestone

Comments

@dmackerman
Copy link

Upgraded to RC3, seems that I'm getting an error with GridList.

Object.GridListController.layout

function getTileSpans(tileElements) {
  return [].map.call(tileElements, function(ele) {
    var ctrl = angular.element(ele).controller('mdGridTile');
    return {
      row: parseInt(
        $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-rowspan'), 10) || 1,
      col: parseInt(
        $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-colspan'), 10) || 1
    };
  });
}
@ThomasBurleson
Copy link
Contributor

Please provide a CodePen or Plunkr that demonstrates this issue. Here are some starter demo templates that you can use/fork:

@ThomasBurleson ThomasBurleson added the needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue label Apr 29, 2015
@ThomasBurleson ThomasBurleson added this to the Backlog milestone Apr 29, 2015
@peter-vbn
Copy link

The error appears when you navigate away from the Grid List demo.

@ThomasBurleson ThomasBurleson modified the milestones: 0.9.0, Backlog Apr 30, 2015
@ThomasBurleson ThomasBurleson self-assigned this Apr 30, 2015
@ThomasBurleson ThomasBurleson removed the needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue label Apr 30, 2015
@rgolea
Copy link

rgolea commented Jul 6, 2015

+1

@ThomasBurleson
Copy link
Contributor

@rgolea - This issue has been closed.

@rgolea
Copy link

rgolea commented Jul 6, 2015

Why did that error happened? I'm getting that in another thing I'm working on.

@ThomasBurleson
Copy link
Contributor

@rgolea - please open a new issue with full details (and preferrably a demo).

@Mellbourn
Copy link

Getting this too in 0.10.0

@voyager1302
Copy link

Hi,
It seems like the issue is not closed.
I'm using Angular material v1.1.1.
Copied the Grid-list sample from angular material site and still get te error:
angular.js:13642 TypeError: Cannot read property '$attrs' of undefined
at http://macbook-pro-2631.local:5757/assets/js/lib/angular-material.js:11007:51
at Array.map (native)
at getTileSpans (http://macbook-pro-2631.local:5757/assets/js/lib/angular-material.js:11003:21)
at Object.layoutDelegate (http://macbook-pro-2631.local:5757/assets/js/lib/angular-material.js:10811:20)
at Object.layout (http://macbook-pro-2631.local:5757/assets/js/lib/angular-material.js:11088:12)
at Object.callback (https://code.angularjs.org/1.5.6/angular.js:1267:18)
at http://macbook-pro-2631.local:5757/assets/js/lib/angular-material.js:1608:23
at Array.forEach (native)
at processQueue (http://macbook-pro-2631.local:5757/assets/js/lib/angular-material.js:1605:15)
at https://code.angularjs.org/1.5.6/angular.js:19308:31(anonymous function) @ angular.js:13642(anonymous function) @ angular.js:10287(anonymous function) @ angular.js:19311completeOutstandingRequest @ angular.js:5912(anonymous function) @ angular.js:6191
www-embed-player.js:222 GET https://googleads.g.doubleclick.net/pagead/id net::ERR_BLOCKED_BY_CLIENTTd @ www-embed-player.js:222Xd @ www-embed-player.js:225(anonymous function) @ www-embed-player.js:1250Dg @ www-embed-player.js:388yq @ www-embed-player.js:1249(anonymous function) @ www-embed-player.js:1301(anonymous function) @ KANDy6Y_e6w?version=3&loop=1&playlist=KANDy6Y_e6w&autoplay=1&frameborder=0&fs=0&iv_load_policy=3&mo…:10

Thanks for the help,
Yehuda

@voyager1302
Copy link

Carlos Hi,

As I mentioned I took the sample from Angular material's site. same code.
here is the url for the code pen:
http://codepen.io/anon/pen/WGQVJv?editors=1111

Thanks, Yehuda

@MicrowaveDev
Copy link

+1

1 similar comment
@jgraygi
Copy link

jgraygi commented Sep 26, 2017

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants