Angular-UI:弹出窗口不起作用
Angular-UI: Popover doesn't work
这是我创建的示例,但它似乎不起作用:
<button popover-placement="bottom" popover-template="'calendar.html'" popover-trigger="click"><h1>Hello Plunker!</h1></button>
<script id="calendar.html" type="text/ng-template">
<datepicker ng-model="date" show-weeks="false"></datepicker>
</script>
我也尝试过在 popover-template
属性中不使用撇号,但没有用。
谁能告诉我我的实现哪里出了问题?提前致谢!
几个问题:
你在angular之前加载ui-bootstrap,所以失败了(我把ui-bootstrap放在angular.js之后) :
<script src="https://code.angularjs.org/1.5.5/angular.js" data-semver="1.5.5" data-require="angularjs@1.5.5"></script>
<script data-require="ui-bootstrap@*" data-semver="1.3.2" src="https://cdn.rawgit.com/angular-ui/bootstrap/gh-pages/ui-bootstrap-tpls-1.3.2.js"></script>
日期选择器指令没有被调用,因为它需要uires "uib-"(注意uib-datepicker):
<button popover-placement="bottom" uib-popover-template="'calendar.html'" popover-trigger="click"><h1>Hello Plunker!</h1></button>
日期选择器指令也没有被调用,因为它需要uires "uib-"(注意uib-datepicker):
<script id="calendar.html" type="text/ng-template">
<uib-datepicker ng-model="date" show-weeks="false"></datepicker>
</script>
这是我创建的示例,但它似乎不起作用:
<button popover-placement="bottom" popover-template="'calendar.html'" popover-trigger="click"><h1>Hello Plunker!</h1></button>
<script id="calendar.html" type="text/ng-template">
<datepicker ng-model="date" show-weeks="false"></datepicker>
</script>
我也尝试过在 popover-template
属性中不使用撇号,但没有用。
谁能告诉我我的实现哪里出了问题?提前致谢!
几个问题:
你在angular之前加载ui-bootstrap,所以失败了(我把ui-bootstrap放在angular.js之后) :
<script src="https://code.angularjs.org/1.5.5/angular.js" data-semver="1.5.5" data-require="angularjs@1.5.5"></script>
<script data-require="ui-bootstrap@*" data-semver="1.3.2" src="https://cdn.rawgit.com/angular-ui/bootstrap/gh-pages/ui-bootstrap-tpls-1.3.2.js"></script>
日期选择器指令没有被调用,因为它需要uires "uib-"(注意uib-datepicker):
<button popover-placement="bottom" uib-popover-template="'calendar.html'" popover-trigger="click"><h1>Hello Plunker!</h1></button>
日期选择器指令也没有被调用,因为它需要uires "uib-"(注意uib-datepicker):
<script id="calendar.html" type="text/ng-template">
<uib-datepicker ng-model="date" show-weeks="false"></datepicker>
</script>