I'm trying to integrate a third party API into my meteor.js app.
So the idea is, when on /blog
route, the app should call external class' method.
router.js
:
import blog from '../imports/scripts/blog';
FlowRouter('/blog', {
name: 'blog',
action: function(params) {
blog.init(); // here I get the error "init is not a function" (it's undefined)
}
});
blog.js
:
export default class Blog {
constructor(){
...
}
init() {
console.log('init blog api');
...
}
}
I'm using the latest meteor (1.4.2.3) and the following npm packages in order to enable ES2015:
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-loader": "^6.2.8",
"babel-preset-es2015": "^6.18.0",
"babel-runtime": "^6.18.0",
"meteor-node-stubs": "^0.2.4",
"webpack": "^1.13.3"
Am I missing anything in my setup that I cannot call blog.init()
?