美文网首页
Angular问题汇总

Angular问题汇总

作者: Yvan_Yang | 来源:发表于2016-08-23 14:48 被阅读0次

    1, ng-transclude
    在IE8下面,错误: TypeError: Object doesn't support this property or method

    指令模板

    <button ng-click="open()">open</button>
    <div class="overlay" ng-class="{'show': isOpen}">    
        <a href="javascript:void(0)" class="closebtn" ng-click="close()">×</a>    
        <div class="overlay-content">        
            <div ng-transclude></div>    
        </div>
    </div>
    

    正确:

    <div jm-fullscreen open="onOpen()">  
    <!--ng-transclude issue:-->  
    <!--if it is no parent container(div) for a tags, it will throw bellow errors in IE8-->  
    <!--TypeError: Object doesn't support this property or method-->  
      <div>      
        <a href="#">About</a>      
        <a href="#">Services</a>      
        <a href="#">Clients</a>      
        <a href="#">Contact</a>  
      </div>
    </div>
    

    错误:

    <div jm-fullscreen open="onOpen()">  
    <!--ng-transclude issue:-->  
    <!--if it is no parent container(div) for a tags, it will throw bellow errors in IE8-->  
    <!--TypeError: Object doesn't support this property or method-->  
    
        <a href="#">About</a>      
        <a href="#">Services</a>      
        <a href="#">Clients</a>      
        <a href="#">Contact</a>  
    
    </div>
    

    相关文章

      网友评论

          本文标题:Angular问题汇总

          本文链接:https://www.haomeiwen.com/subject/cdqnsttx.html