Foundation in an ember cli app using ember.js 2.0

I am working on an ember app using ember-cli.

ember version "2.0.0-beta.2"

I am integrating foundation 5 into my app, installed the bower package for the foundation and also included it in my ember-cli-build.js file

app.import('bower_components/foundation/js/foundation/foundation.js');
app.import('bower_components/foundation/js/foundation/foundation.offcanvas.js');

      

Now I want to initialize the foundation as

Ember.$(document).foundation({
  offcanvas: { close_on_click: true }
});

      

But in ember-2

they completely removed the views, where should I initialize it?

Any thoughts?

Thank.

+3


source to share


1 answer


Finally, you can fix this. Thanks to "Taras Mankovsky"

Here is the solution https://github.com/embersherpa/ama/issues/8

application.hbs



{{#app-canvas}}
  <h2>Welcome to Ember.js</h2>
  {{outlet}}
{{/app-canvas}}

      

components / app-canvas.js

import Ember from "ember";
export default Ember.Component.extend({
  didInitAttrs() {
    Ember.run.schedule("afterRender", function() {
      Ember.$(document).foundation({
        offcanvas: { close_on_click: true }
      });
    });
  },
});

      

+4


source







All Articles