Vì vậy - tôi muốn có một vở kịch với typeahead trong một ứng dụng ember.ember-cli thêm phụ thuộc với bower
tôi nhận được một ứng dụng cli và chạy sau đó tôi chạy
bower install typeahead.js
tôi có thể thấy rằng mã đã được đưa vào bower_components.
tôi sau đó thêm dòng sau vào các 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();
Tuy nhiên nó không hoạt động - tôi nhận được
Uncaught ReferenceError: Bloodhound is not defined
Từ đọc các tài liệu - cài đặt với Chòi chơi và thêm các dòng trong brocfile nên là đủ để đáp ứng nó? Tôi có đọc sai hay đây có phải là lỗi không?
tôi đã tạo ra một repo GIT công cộng trong đó cho thấy vấn đề này:
https://github.com/wayne-o/ember-cli-bootstrap
Tất cả tôi đã làm là:
ember new bootstrap-test
bower install bootstrap
Và sau đó nói thêm:
app.import('bower_components/bootstrap/dist/css/bootstrap.css');
app.import('bower_components/bootstrap/dist/js/bootstrap.js');
để brockfile ...
Nó không hoạt động ...
typeahead.bundle.min.js phải chứa mã vạch. Hãy thử xóa nhập mã bloodhound.js –
Vẫn gặp lỗi:/ – iwayneo
@drorb Tôi đã sửa đổi câu hỏi và thêm repo trên github, hiển thị sự cố ... – iwayneo