diff --git a/test-app/app/components/calculating-device.hbs b/test-app/app/components/calculating-device.hbs
new file mode 100644
index 00000000..f57a382c
--- /dev/null
+++ b/test-app/app/components/calculating-device.hbs
@@ -0,0 +1,27 @@
+
+
+ {{this.result}}
+
+ {{this.expression}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test-app/app/components/calculating-device.js b/test-app/app/components/calculating-device.js
index 4a5c00ce..6ee533cc 100644
--- a/test-app/app/components/calculating-device.js
+++ b/test-app/app/components/calculating-device.js
@@ -1,4 +1,5 @@
import Component from '@ember/component';
+import { action } from '@ember/object';
import { computed as c } from '@ember/object';
export default Component.extend({
@@ -11,33 +12,31 @@ export default Component.extend({
},
}),
- actions: {
- keyPress(key) {
- let result = this.result;
- let stack = this.stack;
- let op = this.op;
+ keyPress: action(function (key) {
+ let result = this.result;
+ let stack = this.stack;
+ let op = this.op;
- switch (key) {
- case '+':
- case '-':
- case '=':
- stack.push(parseInt(op + result));
- this.set('result', '');
- break;
- default:
- this.set('result', result + key.toString());
- break;
- }
+ switch (key) {
+ case '+':
+ case '-':
+ case '=':
+ stack.push(parseInt(op + result));
+ this.set('result', '');
+ break;
+ default:
+ this.set('result', result + key.toString());
+ break;
+ }
- switch (key) {
- case '-':
- this.set('op', '-');
- break;
- case '=':
- result = stack.reduce((result, value) => result + value, 0);
- this.set('result', result.toString());
- break;
- }
- },
- },
+ switch (key) {
+ case '-':
+ this.set('op', '-');
+ break;
+ case '=':
+ result = stack.reduce((result, value) => result + value, 0);
+ this.set('result', result.toString());
+ break;
+ }
+ }),
});
diff --git a/test-app/app/templates/components/clickable-component.hbs b/test-app/app/components/clickable-component.hbs
similarity index 100%
rename from test-app/app/templates/components/clickable-component.hbs
rename to test-app/app/components/clickable-component.hbs
diff --git a/test-app/app/templates/components/html-render.hbs b/test-app/app/components/html-render.hbs
similarity index 100%
rename from test-app/app/templates/components/html-render.hbs
rename to test-app/app/components/html-render.hbs
diff --git a/test-app/app/templates/components/input-elements.hbs b/test-app/app/components/input-elements.hbs
similarity index 100%
rename from test-app/app/templates/components/input-elements.hbs
rename to test-app/app/components/input-elements.hbs
diff --git a/test-app/app/templates/components/login-form.hbs b/test-app/app/components/login-form.hbs
similarity index 100%
rename from test-app/app/templates/components/login-form.hbs
rename to test-app/app/components/login-form.hbs
diff --git a/test-app/app/templates/components/user-list.hbs b/test-app/app/components/user-list.hbs
similarity index 100%
rename from test-app/app/templates/components/user-list.hbs
rename to test-app/app/components/user-list.hbs
diff --git a/test-app/app/controllers/calculator.js b/test-app/app/controllers/calculator.js
index f28d9c33..ca8196d2 100644
--- a/test-app/app/controllers/calculator.js
+++ b/test-app/app/controllers/calculator.js
@@ -1,6 +1,7 @@
import { later } from '@ember/runloop';
import Controller from '@ember/controller';
import { computed as c } from '@ember/object';
+import { action } from '@ember/object';
export default Controller.extend({
init() {
@@ -20,46 +21,44 @@ export default Controller.extend({
},
}),
- actions: {
- keyPress(key, asyncOp) {
- let exec = () => {
- let result = this.expression;
- let stack = this.stack;
- let op = this.op;
+ keyPress: action(function (key, asyncOp) {
+ let exec = () => {
+ let result = this.expression;
+ let stack = this.stack;
+ let op = this.op;
- switch (key) {
- case '+':
- case '-':
- case '=':
- stack.push(parseInt(op + result));
- this.set('result', result);
- this.set('expression', '');
- break;
- default:
- this.set('expression', result + key.toString());
- break;
- }
+ switch (key) {
+ case '+':
+ case '-':
+ case '=':
+ stack.push(parseInt(op + result));
+ this.set('result', result);
+ this.set('expression', '');
+ break;
+ default:
+ this.set('expression', result + key.toString());
+ break;
+ }
- switch (key) {
- case '-':
- this.set('op', '-');
- break;
- case '=':
- result = stack.reduce((result, value) => result + value, 0);
- this.set('expression', result.toString());
- break;
- }
- };
+ switch (key) {
+ case '-':
+ this.set('op', '-');
+ break;
+ case '=':
+ result = stack.reduce((result, value) => result + value, 0);
+ this.set('expression', result.toString());
+ break;
+ }
+ };
- if (asyncOp) {
- this.set('loading', true);
- later(() => {
- this.set('loading', false);
- exec();
- }, 50);
- } else {
+ if (asyncOp) {
+ this.set('loading', true);
+ later(() => {
+ this.set('loading', false);
exec();
- }
- },
- },
+ }, 50);
+ } else {
+ exec();
+ }
+ }),
});
diff --git a/test-app/app/templates/calculator.hbs b/test-app/app/templates/calculator.hbs
index 0827f888..5ccf331c 100644
--- a/test-app/app/templates/calculator.hbs
+++ b/test-app/app/templates/calculator.hbs
@@ -12,22 +12,25 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
\ No newline at end of file
diff --git a/test-app/app/templates/components/.gitkeep b/test-app/app/templates/components/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test-app/app/templates/components/calculating-device.hbs b/test-app/app/templates/components/calculating-device.hbs
deleted file mode 100644
index 7176fd45..00000000
--- a/test-app/app/templates/components/calculating-device.hbs
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
- {{this.result}}
-
- {{this.expression}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test-app/config/environment.js b/test-app/config/environment.js
index 016f2c11..c8c82288 100644
--- a/test-app/config/environment.js
+++ b/test-app/config/environment.js
@@ -7,14 +7,11 @@ module.exports = function (environment) {
rootURL: '/',
locationType: 'auto',
EmberENV: {
+ EXTEND_PROTOTYPES: false,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
- EXTEND_PROTOTYPES: {
- // Prevent Ember Data from overriding Date.parse.
- Date: false,
- },
},
APP: {