Search code examples
twitter-bootstrapember.jsbroccolijs

embercli bootstrap for ember and modal dialog


Anyone using bootstrap-for-ember with embercli ?

I keep getting :

'BootStrap' is not defined.

On a line that reads:

return BootStrap.ModalManager.show('myModal');

Ive got the modal defined in the template and have bootstrap for ember installed via bower and included in my brocfile.js as follows:

app.import('vendor/ember-addons.bs_for_ember/dist/js/bs-core.min.js');
app.import('vendor/ember-addons.bs_for_ember/dist/js/bs-modal.min.js');

I have read other posts (guy was using grunt tho) about ensuring that bs-core is the first loaded... Tried :

app.import('vendor/ember-addons.bs_for_ember/dist/js/bs-core.min.js');
app.import('vendor/ember-addons.bs_for_ember/dist/js/!(bs-core).min.js');

But it didn't make a difference, still getting the error...

Full code in controller is as follows:

 var ApplicationController = Ember.Controller.extend({
        actions:{
            showUser: function(theUser){
                return BootStrap.ModalManager.show('myModal');
            }
        }
    });

Thanks


Solution

  • Try not to take this the wrong way, but you really should be trying to debug more yourself. That error is as plain as day. BootStrap is not defined. A quick look at the source code will tell you why:

    Bootstrap = window.Bootstrap = Ember.Namespace.create()
    

    Change BootStrap to Bootstrap and you won't have that issue any more.