From e7d04ff391afe9a3c2b11a670b907a8ee7ec0a57 Mon Sep 17 00:00:00 2001 From: Samuel Santos Date: Wed, 15 Oct 2014 17:27:20 +0100 Subject: [PATCH] Prevent error when carousel is hidden by ngIf When the carousel is hidden by ngIf the selector tElement[0].querySelector('li') returns null causing the following error: TypeError: Cannot read property 'attributes' of null at Object.compile (http://localhost:9000/bower_components/angular-carousel/dist/angular-carousel.js:221:79) at applyDirectivesToNode (http://localhost:9000/bower_components/angular/angular.js:6473:32) at compileNodes (http://localhost:9000/bower_components/angular/angular.js:6043:15) at compileNodes (http://localhost:9000/bower_components/angular/angular.js:6055:15) at compile (http://localhost:9000/bower_components/angular/angular.js:5976:15) at applyDirectivesToNode (http://localhost:9000/bower_components/angular/angular.js:6386:33) at compileNodes (http://localhost:9000/bower_components/angular/angular.js:6043:15) at compileNodes (http://localhost:9000/bower_components/angular/angular.js:6055:15) at compile (http://localhost:9000/bower_components/angular/angular.js:5976:15) at link (http://localhost:9000/bower_components/angular-route/angular-route.js:903:18)