Support and examples for Ember.Object and Ember.Controller imports

We should stop using global variables and instead import these as
needed.
This commit is contained in:
Robin Ward 2019-10-23 12:55:11 -04:00
parent 0b37a3c235
commit e18af18fec
3 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,8 @@
import ApiKey from "admin/models/api-key";
import { default as computed } from "ember-addons/ember-computed-decorators";
import Controller from "@ember/controller";
export default Ember.Controller.extend({
export default Controller.extend({
@computed("model.[]")
hasMasterKey(model) {
return !!model.findBy("user", null);

View File

@ -1,4 +1,5 @@
import { ajax } from "discourse/lib/ajax";
import EmberObject from "@ember/object";
const WatchedWord = Discourse.Model.extend({
save() {
@ -37,7 +38,7 @@ WatchedWord.reopenClass({
});
return Object.keys(actions).map(n => {
return Ember.Object.create({
return EmberObject.create({
nameKey: n,
name: I18n.t("admin.watched_words.actions." + n),
words: actions[n],

View File

@ -6,6 +6,8 @@ var define, requirejs;
if (typeof Ember !== "undefined") {
EMBER_MODULES = {
"@ember/component": { default: Ember.Component },
"@ember/controller": { default: Ember.Controller },
"@ember/object": { default: Ember.Object },
"@ember/routing/route": { default: Ember.Route }
};
}