angularjs - TypeError: Unable to get property 'insertBefore' of undefined or null reference only On IE -
i angularjs v1.2.0. getting following error on ie11.
typeerror: unable property 'insertbefore' of undefined or null reference @ anonymous function (/scripts/angular.js:3850:11) @ foreach (/scripts/angular.js:303:9) @ enter (/scripts/angular.js:3849:9) @ anonymous function (/scripts/angular.js:18725:17) @ publiclinkfn (/scripts/angular.js:5420:29) @ ngrepeataction (/scripts/angular.js:18723:15) @ $watchcollectionaction (/scripts/angular.js:11299:11) @ scope.prototype.$digest (/scripts/angular.js:11395:21) @ scope.prototype.$apply (/scripts/angular.js:11634:13) @ done (/scripts/angular.js:7635:34)
it works fine on firefox. fails when following custom directives executes.
.directive('appmycoursecards', ['$compile', '$log', function ($compile, $log) { return { restrict: 'e', replace: true, scope: { }, link: function (scope, element, attributes, controller) { var content = '<div class="well well-sm bottomsmallmargin" ng-repeat="schedule in studentsubjectschedules | filtercourses:\'' + attributes.termperiodparingids + '\' ">' + '<div class="row">' + '<div class="col-md-12">' + '<div class="pull-left">{{schedule.ssecname}}</div>' + '</div>' + '</div>' + '</div>'; element.append($compile(content)(scope.$parent)); } }; any highly appreciated.
thanks.
could add details of custom filter 'filtercourses'?
i created plunk of code , works ok in ie11, suspect may filter causing issue. have in plunker
.directive('appmycoursecards', ['$compile', '$log', function ($compile, $log) { return { restrict: 'e', replace: true, scope: { }, link: function (scope, element, attributes, controller) { scope.$parent.studentsubjectschedules = [{ssecname: "name1"}, {ssecname: "name2"}]; var content = '<div class="well well-sm bottomsmallmargin" ng-repeat="schedule in studentsubjectschedules " >' + '<div class="row">' + '<div class="col-md-12">' + '<div class="pull-left">{{schedule.ssecname}}</div>' + '</div>' + '</div>' + '</div>'; element.append($compile(content)(scope.$parent)); } }}]);
Comments
Post a Comment