jeudi 19 janvier 2017

Ember extend ember-cli-addon component from within node_modules directory

I'm using Stripe in my Ember app, and I've set it up following the instructions here : http://ift.tt/1ApJdKC

so as my app stands right now, the ember-checkout component installed via this addon is in

myappname/node_modules/ember-cli-stripe/app/components/stripe-checkout

Now, I want to create a new component "my-stripe-checkout", and have it extend the default ember-cli-stripe component.

I have tried:

import StripeCheckoutComponent from '../node_modules/ember-cli-stripe/app/components/stripe-checkout';
import StripeCheckoutComponent from 'ember-cli-stripe/app/components/stripe-checkout';
import StripeCheckoutComponent from 'app/components/stripe-checkout';

in my my-stripe-checkout component that I generated via Ember g, but to no avail.

I always get an error of this pattern:

Could not find module `app/components/stripe-checkout` imported from `myappname/components/my-stripe-checkout`

And as per this question: How to extend an ember-cli addon?

I tried doing

import StripeCheckoutComponent from 'ember-cli-stripe/components/stripe-checkout';

but same error.

I've also tried both :

export default Ember.StripeCheckoutComponent.extend({ })

and

export default StripeCheckoutComponent.extend({})

to each iteration of the imports, but nothing seems to work. How do I extend an ember-cli-addon component?




Aucun commentaire:

Enregistrer un commentaire