ember-cli

How to test String.prototype.includes in PhantomJS

大城市里の小女人 提交于 2019-12-22 04:05:30
问题 I have an ember-cli 0.2.7 using Ember.js 1.12.0 app with a piece of code that looks like: controllers/cart.js import Ember from 'ember'; export default Ember.Controller.extend({ footwearInCart: Ember.computed('model.@each.category', function() { return this.get('model').any(product => product.get('category').includes('Footwear')); }) }); It goes through all the objects in the model and returns true if their category property has 'footwear' in it. I'm trying to test it like so: tests/unit

Ember.js: how to analyze error in vendor.js

扶醉桌前 提交于 2019-12-21 18:02:03
问题 I've deployed my ember-cli app in stage environment to let teammates test the app. In the app I have implemented Ember.onerror to email me errors that occur in stage and in production environment. Ember.onerror = function(data) { Ember.$.ajax({ type: "POST", url: url + "/error", dataType: 'json', contentType: 'application/json', data: JSON.stringify({message: data.message, stacktrace: data.stack}), beforeSend: function (xhr, settings) { xhr.setRequestHeader('Accept', settings.accepts.json); }

How to integrate Twitter Bootstrap into an ember-cli app?

允我心安 提交于 2019-12-21 17:27:49
问题 I am using Ember 1.7.0 and trying to integrate the Twitter Bootstrap CSS Framework into an ember-cli app. I have seen some articles about this online, but most seem to be pretty outdated. As of today, I've managed to put information from articles online together and have come up with this. bower install --save bootstrap-sass-official Then check bower.json to see if something along the lines is included: "bootstrap-sass-official": "~3.3.1" Include the following lines in your Brocfile.js : app

Ember CLI: custom input helper

放肆的年华 提交于 2019-12-21 15:46:31
问题 I'm trying to extend Ember's TextField with UrlField so that if someone forgets to include http:// , it does it for them. Here's my View: views/input-url.js import Ember from 'ember'; export default Ember.TextField.extend({ type: 'url', didInsertElement: function() { this._super.apply(this, arguments); this.formatValue(); }, onValueChange: function() { this.formatValue(); }.observes('value'), formatValue: function() { var pattern = /^https{0,1}:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+/g; if (pattern

Fixing Initializers deprecation in Ember 1.12.0

时光毁灭记忆、已成空白 提交于 2019-12-21 12:30:22
问题 I am refering to this particular deprecation that was introduced in Ember 1.12 lookup was called on a Registry. The initializer API no longer receives a container, and you should use an instanceInitializer to look up objects from the container I looked at the guide, but I am unsure on how to fix this. Here's a snippet of the code I have at the moment initialize = (container, app) -> auth = container.lookup('auth-manager:main') local_config = ($.ajax type: 'GET' url: '/config.json' async:false

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

我的未来我决定 提交于 2019-12-21 09:24:15
问题 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",

How to import an amd module in ember-cli?

偶尔善良 提交于 2019-12-21 03:39:49
问题 I am building an EmberJS application with the great help of ember-cli , which is great, but I have an error and I cannot find what I am doing wrong. Here is what I do in my broccoli file: app.import('vendor/underscore/underscore.js', { exports: { "underscore": [ "underscore" ] } }); and then in one of my controllers: import _ from "underscore"; ember-cli builds my application. But when I go to the controller using underscore, I get the error: Error: Could not find module underscore. What am I

Ember CLI Live Reload Not Working

笑着哭i 提交于 2019-12-20 12:36:29
问题 I've seen other similar questions here and here but neither of those worked for me. I'm on a mac and simply installed ember cli using npm and I thought it would work out of the box. Here is the server output: version: 0.1.4 Could not find watchman, falling back to NodeWatcher for file system events Livereload server on port 35729 Serving on http://0.0.0.0:4200/ Build successful - 2456ms. Slowest Trees | Total -------------------------------+---------------- EsnextFilter | 877ms TreeMerger |

Why is my ember-cli build time so slow on windows?

风格不统一 提交于 2019-12-20 11:24:11
问题 Ember-cli is building very slowly with ember server on windows. Build successful - 13126ms. Slowest Trees | Total -------------------------------+---------------- TreeMerger (vendor) | 3154ms TreeMerger (stylesAndVendor) | 2051ms TreeMerger (appAndDependencies) | 1914ms StaticCompiler | 1791ms This is in contrast to the same project building in less that 1 second on a linux box. 回答1: Official recommendation from ember-cli to improve its performance on windows Install ember-cli-windows with

Why is my ember-cli build time so slow on windows?

给你一囗甜甜゛ 提交于 2019-12-20 11:24:06
问题 Ember-cli is building very slowly with ember server on windows. Build successful - 13126ms. Slowest Trees | Total -------------------------------+---------------- TreeMerger (vendor) | 3154ms TreeMerger (stylesAndVendor) | 2051ms TreeMerger (appAndDependencies) | 1914ms StaticCompiler | 1791ms This is in contrast to the same project building in less that 1 second on a linux box. 回答1: Official recommendation from ember-cli to improve its performance on windows Install ember-cli-windows with