ember-cli

I am gettting the error: Compile Error: ifCond is not a helper when I am trying to write a helper function in Ember

梦想的初衷 提交于 2019-12-04 06:42:08
问题 I have a helper function (ifCond) in ember.js as below export default () => { Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) { alert("hi"); if (params[3]) { //handle case insensitive conditions if 4 param is passed. params[0] = params[0].toLowerCase(); params[2] = params[2].toLowerCase(); } let v1 = params[0]; let operator = params[1]; let v2 = params[2]; switch (operator) { case '==': return (v1 == v2); case '!=': return (v1 != v2); case '===': return (v1 === v2);

emberjs 2 connect to an api flask - Encountered a resource object with an undefined type

僤鯓⒐⒋嵵緔 提交于 2019-12-04 02:54:22
I'm learning Ember and after some basic test, I tried to connect with my API to created a search component. API 'application/vnd.api+json' { "data": [ { "expediente": "1717801", "fecha_de_presentacion": "01/02/2016 12:00:00 AM", "figura_juridica": "REGISTRO DE MARCA", "logotipo": null, "signo": "IGUY", "tipo": "NOMINATIVA", "titular": "SAMSONITE IP HOLDINGS S.\u00c0.R.L." }, { "expediente": "1717793", "fecha_de_presentacion": "01/02/2016 12:00:00 AM", "figura_juridica": "REGISTRO DE MARCA", "logotipo": "1_files/direct_151.gif", "signo": "URGOSTART", "tipo": "MIXTA", "titular": "HCP HEALTHCARE

How should I share data between Ember components?

為{幸葍}努か 提交于 2019-12-04 02:37:55
My Ember app has a route that contains 2 different components and one controller with an index.hbs template. Here's what it looks like: 1) A user can select multiple filters from the dropdowns of the Filter Component 2) The DataGrid is a separate component from the filter 3) A user can select multiple rows from the DataGrid by checking boxes 4) Create Custom Report button fires "sendAction" to the route's controller This data is not model-specific... it's just temporary data that is required before I can make a custom report. Ember best practices are "Data Down / Actions Up", and from what I

Environment-based host in Ember CLI app

懵懂的女人 提交于 2019-12-04 02:26:51
I'm trying to configure the adapter in my Ember CLI app to use a different host based on the environment. In dev, I want it to be the default current host (letting me customize it via the --proxy option, but in production I know it will be http://some.url . I tried importing my ENV into my application adapter: // adapters/application.js import DS from "ember-data"; import ENV from "../../config/environment"; export default DS.ActiveModelAdapter.extend({ host: ENV.host }); but I'm getting an error that tmp/tree_merger../config/environment.js doesn't exist. andorov You are pretty close. You

Using mixins with Ember-cli?

血红的双手。 提交于 2019-12-04 01:22:24
I have a mixin app/mixins/ui-listener.js which I'm struggling to use with Ember-CLI. I'm trying to use the mixin with the following syntax: import ListenerMixin from './mixins/ui-listener'; export default Ember.Component.extend(ListenerMixin,{ // class definition } This fails when I save it, complaining that ENOENT, no such file or directory 'tmp/tree_merger-tmp_dest_dir-74tK3rvD.tmp/[app-name]/components/mixins/ui-listener.js' It seems funny that the "mixins" directory is nested under the "components" directory (as Ember-CLI puts these directories at the same level) but this may just a

How to extend an ember-cli addon?

喜欢而已 提交于 2019-12-04 00:38:45
In my ember-cli app i have installed an addon called 'ember-cli-selectize' . Looking at the directory structure i can see that its files are located at /node_modules/ember-cli-selectize' . Now i want to create a custom component that extends this addon. How do i import/require it? I've tried these and none seems to work: var EmberSelectize = require('/ember-cli-selectize/app/components/ember-selectize'); import EmberSelectize from 'components/ember-selectize'; import EmberSelectize from 'node_modules/ember-cli-selectize/addon/components/ember-selectize'; import EmberSelectize from 'ember-cli

Iframe in Chrome error: Failed to read 'localStorage' from 'Window': Access denied for this document

北战南征 提交于 2019-12-03 22:19:16
I have a web app which uses localStorage. Now we want to embed this web app on other (third-party) sites via iframe. We want to provide an iframe embed similar to youtube so that other websites can embed our web app in an iframe. Functionally it is the same as if it wouldn't be embedded. But it does not work. Chrome prints the error message: Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. I just do the following check (in the iframe): if (typeof window.localStorage !== 'undefined') { // SETUP SESSION, AUHT, LOCALE, SETTINGS

Ember CLI and code coverage

家住魔仙堡 提交于 2019-12-03 16:08:52
问题 Has anyone managed to get code coverage working with an Ember CLI project? I've tried using blanket.js and istanbul, as have others here, here and here, neither with any success. I've managed to get each to actually produce a coverage report but the report either says 0% (istanbul) or 100% (blanket.js), and there's no way the current tests provide 100% coverage. The built project JavaScript file that Ember CLI produces contains all of the project's source files with each file's contents being

Correct way to access current application configuration

▼魔方 西西 提交于 2019-12-03 15:50:29
问题 I added some configurations to myapp/config/environment : if (environment === 'development') { ENV.APP.AuthURL = 'http://localhost:5000/'; } Now, to access this configuration should I use some method or directly accessing window.Myapp ? 回答1: There are a couple modern ways, as of this writing, when trying to access it from your application: import ENV from 'your-application-name/config/environment'; your-application-name should be what's in the modulePrefix key of config/environment.js and the

How to debug slow Ember CLI/Broccoli builds

寵の児 提交于 2019-12-03 15:30:15
问题 My Ember CLI project is currently taking 8-9 seconds to build, and I'd like to understand why. The project is not that large (~180 files under app/ including hbs and scss). Here's my brocfile: https://gist.github.com/samselikoff/874c90758bb2ce0bb210 However, even if I comment my entire Brocfile out and export just the app variable, the build still takes 5-6 seconds. I'm not quite sure how debug. Here's my slowest tree logs: Build successful - 8874ms. Slowest Trees | Total --------------------