簡體   English   中英

popover在angularjs的onui ui中不起作用

[英]popover not working in onsen ui with angularjs

我已經對onsenui演示,我需要使用此一酥料餅的 ,我已經搜查,發現在溫泉UI本身酥料餅的支持,所以我在下面的鏈接,試圖按照步驟酥料餅在溫泉UI

html

但它不起作用,並在控制台中顯示“ TypeError:href為null ”,我的代碼如下, html

<ons-page ng-controller="listingController">
    <ons-toolbar style="background: #da1e3e;">

   <div class="left">
     <ons-back-button>Back</ons-back-button>
   </div>

        <div class="center">Listing</div>

   <div class="right">
     <span class="toolbar-button--quiet navigation-bar__line-height" ng-click="gallery.pushPage('filter.html');" style="border: none; padding: 0 0 4px 0;">
       <i class="ion-android-options" style="font-size:24px; color: #FFFFFF;"></i>
     </span>
<!--      <span class="toolbar-button--quiet navigation-bar__line-height"  ng-click="toggleModal('Success')" >-->
           <span class="toolbar-button--quiet navigation-bar__line-height"  ng-click="show('#navigation')" >-->
         <i class="ion-android-more-vertical" style="font-size:26px;"></i>
       </span>
        <modal visible="showModal"  >
     <ul>
       <h4 align="left">Featured</h4>
  <h4 align="left">Name(A-Z)</h4>
  <h4 align="left">Rating</h4>
 <h4 align="left">Most Popular</h4>
     </ul>
  </modal>
   </div>
 </ons-toolbar>

    <div class="app-page" >
   <div class="list-wrap">
    <ons-list class="list ons-list-inner list--categories" modifier="categories">
        <div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div> 

    </ons-list>
   </div>
  </div>



</ons-page>  

<script type="text/ons-template" id="popover.html">
  <ons-popover direction="up down" cancelable>
    <div style="text-align: center; opacity: 0.5;">
      <p>This is a popover!</p>
      <p><small>Click the background to remove the popover.</small></p>
    </div>
  </ons-popover>
</script>

js

ons.createPopover('popover.html').then(function(popover) {
    $scope.popover = popover;
  });

請幫助我保存..謝謝

據我所知ons-popovers應該放在模板下。 請參考以下代碼

的HTML

<div class="navigation-bar__right" ng-controller="myPopoverController">
    <ons-icon class="button button--quiet" icon="ion-ios-information-outline" size="20px" fixed-width="false" ng-click="popover.show($event)"></ons-icon>
</div>
<ons-template id="myPopover.html">
    <ons-popover cancelable direction="down">
        <div style="text-align: center;">
            <ons-list>
                <ons-list-item>List 1</ons-list-item>
                <ons-list-item>List 2</ons-list-item>
                <ons-list-item>List 3</ons-list-item>
            </ons-list>
        </div>
    </ons-popover>
</ons-template> 

JS

myApp.controller('myPopoverController', function ($scope) {

    ons.createPopover('myPopover.html').then(function (popover) {
        $scope.popover = popover;
    });
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM