angularJS parentNode of directive is null -


i have defined directive, , specified template , added compile function. below

mainapp.directive("myspan", function () {     return {         restrict: 'e',         template: '<span style=\"background-color:gray;color:orange\">pppdsf</span>',         replace: true,         require:'^uiscroll',         compile: function (template, attrs) {             return {                 post:function (scope, element, attrs, scrollcontroller) {                     var pp = 1;                 }             }         }     } }); 

but there error can't find scrollcontroller. reason template[0].parentnode.parentnode null, not find parentnode's controller property. has encountered error before?

<div ng-controller="maincontroller mainctr">     <ul class="dataarea">         <li ui-scroll="item in suggestionlist.datasource" buffer-size="10">             <my-span></my-span>         </li>     </ul> </div> 


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -