【发布时间】:2015-01-26 13:19:43
【问题描述】:
我在玩 polymerjs。
目标
我想使用 polymerjs 创建一个自定义元素,并将引导模式对话框封装在这个自定义元素中。干净的解决方案似乎是使用mike costello's bootstrap-web-components
boostrap-modal.html
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/bootstrap-web-components/dist/imports.html">
<polymer-element name="bootstrap-modal" attributes="script css">
<template>
<bs-modal title="Title" show="false">
Dialog Contents
</bs-modal>
</template>
<script>
</script>
</polymer-element>
问题
我使用 bower 来安装库。我的项目有根 Polymer,并且在此文件夹中包含 index.html 文件、bower.json 文件和文件夹 bower_components。我的 bootstrap 和 bootstrap-web-components 文件夹位于 bower_components 文件夹中。我只在我的自定义元素中导入 bootstrap-web-components imports.html 文件。
运行时,我在 bootstrap-web-components.js 的第 13 行收到 Uncaught TypeError: undefined is not a function
感谢您的帮助!
【问题讨论】:
标签: twitter-bootstrap polymer bower-install