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

Commit 38f0423

Browse files
author
Robert Messerle
committed
fix(list): adds role attributes in compile rather than link for performance improvements
#1771
1 parent 8911fad commit 38f0423

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/components/list/list.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ angular.module('material.components.list', [
4848
function mdListDirective() {
4949
return {
5050
restrict: 'E',
51-
link: function($scope, $element, $attr) {
52-
$element.attr({
53-
'role' : 'list'
54-
});
51+
compile: function(element) {
52+
element[0].setAttribute('role', 'list');
5553
}
5654
};
5755
}
@@ -79,10 +77,8 @@ function mdListDirective() {
7977
function mdItemDirective() {
8078
return {
8179
restrict: 'E',
82-
link: function($scope, $element, $attr) {
83-
$element.attr({
84-
'role' : 'listitem'
85-
});
80+
compile: function(element) {
81+
element[0].setAttribute('role', 'listitem');
8682
}
8783
};
8884
}

0 commit comments

Comments
 (0)