I'm very new to Ember and using Ember-CLI but I'm trying to set a private token for login using jQuery cookie, but it isn't defined. Please let me know if I'm doing the bower/broccoli stuff right. Most of the bower stuff was part of the scaffolded Ember-CLI app:
bower.json
{
"name": "my_app",
"dependencies": {
"jquery": "^1.11.1",
"ember": "1.10.0",
"ember-data": "1.0.0-beta.15",
"ember-resolver": "~0.1.12",
"loader.js": "ember-cli/loader.js#3.2.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2",
"ember-qunit": "0.2.8",
"ember-qunit-notifications": "0.0.7",
"qunit": "~1.17.1",
"bootstrap-sass-official": "~3.3.4",
"fontawesome": "~4.3.0",
"jquery-cookie": "~1.4.1"
}
}
Brocfile
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
app.import('bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js');
app.import("bower_components/jquery-cookie/jquery.cookie.js");
module.exports = app.toTree();
I've tried both (in Controller and Chrome console):
$.cookie()
and
Ember.$.cookie()
But for both I get:
Uncaught TypeError: undefined is not a function
Aucun commentaire:
Enregistrer un commentaire