所以 - 我想要在一个应用程序中的typeahead玩。ember-cli增加依赖关系与鲍尔
我得到一个CLI应用程序启动并运行,然后我跑
bower install typeahead.js
我可以看到,该代码已投入bower_components。
我然后添加以下到brocfile:
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
app.import('bower_components/typeahead.js/dist/typeahead.bundle.min.js');
module.exports = app.toTree();
但是它不工作 - 我得到
Uncaught ReferenceError: Bloodhound is not defined
从阅读的文档 - 与亭子安装和添加的行brocfile应该足以满足它?我读错了还是这是一个错误?
我创建了一个公共GIT回购这说明此问题:
https://github.com/wayne-o/ember-cli-bootstrap
我所做的是:
ember new bootstrap-test
bower install bootstrap
然后补充说:
app.import('bower_components/bootstrap/dist/css/bootstrap.css');
app.import('bower_components/bootstrap/dist/js/bootstrap.js');
到brockfile ...
它没有工作...
typeahead.bundle.min.js应该包含bloodhound。尝试删除bloodhound.js导入 – 2014-09-21 17:37:32
仍然收到错误:/ – iwayneo 2014-09-21 17:43:40
@drorb我已经修正了这个问题,并在github上添加了一个回购显示问题... – iwayneo 2014-09-22 15:16:46