I am using version 0.0.46 of Ember CLI.
In my bower.json file I have defined
{
"name": "my-app",
"dependencies": {
"handlebars": "~1.3.0",
"jquery": "^1.11.1",
"ember": "1.7.0",
"ember-data": "1.0.0-beta.10",
"ember-resolver": "~0.1.7",
"loader": "stefanpenner/loader.js#1.0.1",
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
"ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2",
"ember-qunit": "0.1.8",
"ember-qunit-notifications": "0.0.4",
"qunit": "~1.15.0",
"interact": "~1.0.26",
"moment": "2.8.3"
}
}
Did a bower install which loaded moment into bower_components. And in my Brocfile.js I have imported it.
app.import('bower_components/moment/moment.js');
module.exports = app.toTree();
And in my .jshintrc I have included it.
"predef": [{
"document": true,
"window": true,
"-Promise": true,
"moment": true
}]
And I created an application route just to see about getting it working.
import Ember from "ember";
var ApplicationRoute = Ember.Route.extend({
currentDate: null,
setupController: function(controller, model) {
this._super(controller, model);
this.set('currentDate', moment());
}
});
export default ApplicationRoute;
It comes back saying moment is undefined. I have tried with momentjs and interactjs but neither want to work.
I tried adding
/* global moment */
to the application route. I also tried
/* global moment:true */
but still nothing.
Does anyone see what I'm doing wrong? Or is this a bug in version 0.0.46 of Ember CLI?
Thanks!
ember serve
process and restart when editing the brocfile. have you tried that? – tikotzkymoment
do you get anything back? – tikotzky