Tak więc - chcę mieć grę z typem główki w aplikacji ember.ember-cli dodawanie zależności z altanką
uzyskać CLI aplikacji i działa potem biegnę
bower install typeahead.js
widzę, że kod został wprowadzony do bower_components.
Następnie dodać następujące do 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();
Jednak to nie działa - mam
Uncaught ReferenceError: Bloodhound is not defined
Od czytania docs - instalację z altany i dodanie linii w brocfile powinien wystarczyć, aby go zaspokoić? Czy czytam to źle, czy to błąd?
Stworzyłem repo GIT publiczny, który pokazuje ten problem:
https://github.com/wayne-o/ember-cli-bootstrap
Wszystko zrobiłem to:
ember new bootstrap-test
bower install bootstrap
, a następnie dodaje:
app.import('bower_components/bootstrap/dist/css/bootstrap.css');
app.import('bower_components/bootstrap/dist/js/bootstrap.js');
do plik brockfile ...
Nie zadziałało ...
typeahead.bundle.min.js powinien zawierać bloodhound. Spróbuj usunąć plik bloodhound.js import –
Nadal dostaję błąd:/ – iwayneo
@drorb Zmieniłem pytanie i dodałem repo na github, które pokazuje problem ... – iwayneo