【问题标题】:How can I use ember-simple-auth with ember-cli?如何将 ember-simple-auth 与 ember-cli 一起使用?
【发布时间】:2014-05-24 04:36:57
【问题描述】:

我正在尝试将 https://github.com/simplabs/ember-simple-auth 上的说明改编为使用 ember-cli v0.0.28 构建的应用程序。我对 ember-cli 和 AMD 模块的使用相当陌生。

谁能帮助以正确的方式/位置导入 ember-simple-auth 而不是 README 中涵盖的全局命名空间?

下面的初始化器

import SimpleAuth from 'vendor/ember-simple-auth/amd/ember-simple-auth';

export default {
  name: 'authentication',
  initialize: function(container, application) {
    SimpleAuth.setup(container, application);
  }
}

被编译成

define("myapp/initializers/ember-simple-auth", 
  ["vendor/ember-simple-auth/amd/ember-simple-auth","exports"],
  function(__dependency1__, __exports__) {
    "use strict";
    var SimpleAuth = __dependency1__["default"];

    __exports__["default"] = {
      name: 'authentication',
      initialize: function(container, application) {
        SimpleAuth.setup(container, application);
      }
    }
  });//# sourceURL=myapp/initializers/ember-simple-auth.js

__dependency1__ 是未定义的。

【问题讨论】:

    标签: ember-cli ember-simple-auth


    【解决方案1】:

    请参阅 README 中的 ember-cli 安装说明:https://github.com/simplabs/ember-simple-auth#installation - 不幸的是,目前还不能导入 Ember.SimpleAuth 的各个部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多