所以 - 我想要在一個應用程序中的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