jQuery cookie没有定义emberjs

时间:2015-03-24 19:14:59

标签: javascript jquery cookies ember.js ember-cli

我对Ember很新,并使用Ember-CLI,但我正在尝试使用jQuery cookie设置一个私有令牌进行登录,但它没有定义。如果我正在做凉亭/西兰花的话,请告诉我。大多数凉亭的东西都是脚手架Ember-CLI应用程序的一部分:

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();

我已经尝试过(在Controller和Chrome控制台中):

$.cookie()

Ember.$.cookie()

但对于我得到的两个:

Uncaught TypeError: undefined is not a function

0 个答案:

没有答案