Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. ...
  2. $scope.firstItem = data[0];
  3. ....
  4.  
  5. module.exports = function(){
  6.  
  7. return function(scope, element, attrs) {
  8. scope.$watch('$parent.firstItem', function(oldValue, newValue){
  9. var firstTableRow = element[0].children[0].children[0];
  10.  
  11. if ( firstTableRow !== undefined ) {
  12. firstTableRow.classList.add('info');
  13. firstTableRow.focus(); // Todo: Not focusing, need to find out why
  14. }
  15. });
  16. };
  17. };
  18.  
  19. firstTableRow.trigger('click');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement