Quantcast
Channel: Ember.JS - Latest topics
Viewing all 4840 articles
Browse latest View live

Using ember addon with new ember

$
0
0

@Jamiu_Adeleke wrote:

Hello, I am trying to integrate a calendar component in a new ember app and I am having troubles with both addons I am experimenting with. I am looking at ember-calendar and ember-fullcalendar.

Both addon currently do not seem to work out of the box with ember 3.15 even though I ve used them in older project. Is there any way to make things that work the old way work in the new Ember?

While troubleshooting the ember-fullcalendar, one of the problems was import Ember from 'ember';

I read that installing ember-cli-shims can fix the problem but did not work for me.

Does this mean we need to rollback to older version of ember to use this addons?

Posts: 2

Participants: 2

Read full topic


상당수는 standardcharteredsecurities.co.kr/theking/ - 더킹카지노

Ember.js - The Ember Times - Issue No. 131

Is pods file layout deprecated?

Why do i get warning with model lifecycle deprecated?

$
0
0

@1115 wrote:

in Ember 3.15

I generated model and defined attributes. when I execute findRecord(), I got warning with model lifecyclle deprecated.

I didn’t use model lifycycle event;

What is the reason?

my model source

import Model, { attr, belongsTo } from '@ember-data/model';

export default class UserModel extends Model {
	@attr('string') nickname;
	@attr('string') email;
	@attr('number') state;
	@attr('string') auth;
	@attr('string') google;
	@attr('string') kakao;
}

and application adapter

import RESTAdapter from '@ember-data/adapter/rest';
import config from '../config/environment';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';

export default class ApplicationAdapter extends RESTAdapter {
  @service utils;
  @service session;

  host = config.serverHost;
  namespace = `api/${config.appid}`;

  @computed('session.token')
  get headers() {
    return { 'Authorization' : this.session.getCookie('happykoo-tmp') }
  }

}

and application serializer

export { default } from '@ember-data/serializer/rest';

Posts: 1

Participants: 1

Read full topic

Ember cli places js file inside templates dir if i try `ember generate route overview --in-repo app-mgmt`

$
0
0

@Mohana_Priya wrote:

I have been trying ember engines recently and was using ember cli for generating my routes and controllers. I have created an app called engnTest and created an in-repo-engine 'user-profile' inside. Things were working fine unless i tried generating a route inside user-profile engine. It had generated a overview.js file inside the templates dir.

Ember version used: Ember Octane (3.15.2)

ember generate route overview --in-repo user-profile

Files created:

engnTest/lib/user-profile/app/routes/overview.js

engnTest/lib/user-profile/app/templates/overview.js

engnTest/lib/user-profile/addon/routes/overview.js

engnTest/lib/user-profile/addon/templates/overview.hbs

Someone help me find why this happens ? Why are files generated inside addon ?

Thanks in advance, Mohanapriya C

Posts: 1

Participants: 1

Read full topic

Ember.js - Ember 3.16 Released

$
0
0

@ember-blog wrote:

Today the Ember project is releasing version 3.16 of Ember.js, Ember Data, and Ember CLI. This release kicks off the 3.17 beta cycle for all sub-projects. We encourage our community (especially addon authors) to help test these beta builds and report any bugs before they are published as a final release in six weeks' time. The ember-try addon is a great way to continuously test your projects against the latest Ember releases.


This is a companion discussion topic for the original entry at https://emberjs.com/blog/2020/02/12/ember-3-16-released.html

Posts: 1

Participants: 1

Read full topic

How to import all the components and utils in one in-repo-engine into another?

$
0
0

@Mohana_Priya wrote:

I have created two in-repo-engines, my-engine and common-engine in my ember app. I want all the components inside common-engine in my-engine. As far i have seen i need to re-export that component by creating all the files again inside my-engine.

Is there any other way to import the entire engine inside the other ?

Thanks in advance, Mohanapriya C

Posts: 1

Participants: 1

Read full topic


How to prevent ember from adding a wrapper `div` with a class='ember-view'

$
0
0

@larry_karani wrote:

How do I prevent the wrapper div that is generated from wrapping the data in a table row it is messing up with the styles.

Posts: 3

Participants: 2

Read full topic

Ember.js - The Ember Times - Issue No. 135

$
0
0

@ember-blog wrote:

Happy Valentine's Day, Emberistas! 💌

Learn about Native Decorator Support from EmberMap 🐹🗺️, review the RFC for splarguments 💖, autotracking! a blog series on reactivity systems 🤖, JSParty podcast with Jen and Chris 📻, and three reasons to switch to angle bracket syntax in Ember Octane 💡!


This is a companion discussion topic for the original entry at https://emberjs.com/blog/2020/02/14/the-ember-times-issue-135.html

Posts: 1

Participants: 1

Read full topic

Moving ember-data-model-fragments from bower to packjage.json

$
0
0

@neoEmber wrote:

Hi

I am updaring an old Ember app 1.13 to Ember 3 eventually but at the stage of moving to Ember 2.13 at the moment.

I have fixed all the code issues but now I get a problem when trying to move ember-data-model-fragments out of Bower and use NPM instead

I get the error below - I have deleted the tmp/ dir and the dist/ dir too

I have done cache clean for NPM and Bower (just in case) and still no luck , any ideas ?

Build failed.
Build Canceled: Broccoli Builder ran into an error with `SourceMapConcat` plugin. 💥
ENOENT: no such file or directory, open '/Users/user/Development/Homestead/sites/newalt/project/orders/tmp/source_map_concat-input_base_path-2AUIZjUr.tmp/bower_components/ember-data-model-fragments/dist/ember-data-model-fragments.js'


{
  "name": "Cust",
  "version": "1.0.0",
  "description": "Creates and dispatches customers",
  "engines": {
"node": ">= 4"
  },
  "private": true,
  "author": "",
  "directories": {
"doc": "doc",
"test": "tests"
  },
  "repository": "",
  "scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember test",
  },
  "devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-aupac-typeahead": "2.1.2",
"ember-cli": "2.13.0",
"ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^6.0.0",
"ember-cli-bootstrap-sassy": "0.5.5",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-eslint": "^3.0.0",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.4.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-md5": "0.1.0",
"ember-cli-moment-shim": "3.0.1",
"ember-cli-qunit": "^4.0.0-beta.1",
"ember-cli-sass": "6.0.0",
"ember-cli-shims": "^1.1.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-tinymce": "0.1.5",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.13.0",
"ember-data-model-fragments": "1.13.3",
"ember-export-application-global": "^2.0.0",
"ember-font-awesome": "2.2.0",
"ember-load-initializers": "^1.0.0",
"ember-moment": "7.3.0",
"ember-resolver": "^4.0.0",
"ember-simple-auth": "1.0.1",
"ember-simple-auth-token": "^1.0.0",
"ember-source": "~2.13.0",
"ember-welcome-page": "^3.0.0",
"liquid-fire": "0.24.1",
"loader.js": "^4.2.3"
  },
  "license": "MIT",
  "dependencies": {
"font-awesome": "^4.7.0",
"git-repo-info": "^2.0.0"
  }
}

Posts: 1

Participants: 1

Read full topic

Ember CLI Build Using Dynamic Parameter From Config or DotENV

$
0
0

@reykario wrote:

Hello i have a question regarding the ember-cli-build.

So i have ember apps that intended to load different assets (css,js,addons) based on parameter that i add in dotEnv or in config/environment.js. The aim is to make ember app able to load dynamic asset based from where the url is accesssed.

The Questions is. Does ember-cli-build can get configuration parameter or get another value from dotEnv file ?

Posts: 1

Participants: 1

Read full topic

hasMany relationship not workling with inherited model

$
0
0

@felipe wrote:

Hi,
first, explaining the models:

  1. A Parent model that have a “hasMany” relationship
  2. A Child model
  3. The Address model ( the “hasMany”) which has a “belongsTo” Parent.

And, at some point in the application, I receive a Child payload with the addresses, but, for some reason I don’t know (yet), the addresses are not binding to the Child model properly.

It’s something like this:

// person.js
export default DS.Model.extend({
    // . . .
    addresses: DS.hasMany('address', {async: false})
})

// customer.js
export default Person.extend({
    // . . .
})

// address.js
export default DS.Model.extend({
    person: DS.belongsTo('person')
})

The addresses are in the payload, but Customer model does not have the addresses in it.

What I am doing wrong?

Thanks!

Posts: 1

Participants: 1

Read full topic

Ember action on select component crashing chrome debugger

$
0
0

@Jamiu_Adeleke wrote:

I am trying to use an action on a select component on Ember 3.15.

<select id=“select” {{on “click” this.selected}}> – Select One –

and in the component action: @action selected() { let x= 3; }

applying a break point in the action crashes chrome but works fine in firefox. with error Aww snap : "Dev tools disconnected from page …"

Same test with a button works fine.

Is this normal or am I doing something wrong? Is this Ember issue or Chrome issue? Updated to latest version of chrome today version: 80.0.3987.116 and issue persist

Posts: 1

Participants: 1

Read full topic

Communication bridge between microfrontends

$
0
0

@PoslinskiNet wrote:

Hi … I wonder what are your experiences (or ideas) in building large apps that combines multiple tools at once (like Ember, Angular, Vue & React for instance). My main concern is how to handle properly and in generic fashion communication between each micro-app no matter which technology is used there.

So the main goal is to have a common/standardized communication bridge that will allow each micro-app to speak to each other. The most straightforward and flexible solution that I got so far is to rely on RxJS as a message bus that each app can subscribe to (depending on the topic of interest).

Posts: 1

Participants: 1

Read full topic


Testing ember-animated apps

$
0
0

@balint wrote:

Hi,

We recently had intermittent test failures in a fairly big Ember app that uses ember-animated transitions in a few places.

(I’m going to go into details below but I’m also interested to hear how you test parts of your app where you have ember-animated transitions, so feel free to chime in even if you don’t have answers for my specific questions below.)

Digging down into the problem I came across an ember-animated test helper called animationsSettled. It seems to be the ember-animated aware equivalent of the settled helper for built-in test helpers. It waits for all ember-animated transitions to finish before moving on to the next line in the test.

The test failures were only produced if tests (integration and acceptance) were run in a certain order. The fix was to add await animationsSettled() everywhere where an action (like click) triggered an animation. So we managed to overcome the problem but it left me with a few questions that I’d like to understand better.

  1. Is it possible for animations to “linger” between tests? In our case, each of the tests passed when run in isolation. However, if we missed to insert an animationsSettled in one test, it seemed to have broken a next one run after it (and possibly, though I’m not 100% sure about this, breaking it by hanging the next animationsSettled).
  2. It seems a bit too much to ask of the developer to know exactly which actions can trigger animations. In our case, even a visit could trigger it because a component also animated when it was first inserted. This makes someone relatively new to that part of the code having to spend quite some time figuring this out. Maybe that’s just how things are, but I wonder if there’s an easier way around this. (see next point)
  3. To address the previous point, would it make sense for all the built-in test helpers (click, visit, triggerEvent, etc.) to detect if a project uses ember-animated and then have settled also wait for animations (= call animationsSettled) behind the scenes? It’d add some overhead but the previous point would be vastly improved.
  4. ember-animated alls add a hook, setupAnimationTest which adds a bunch of useful assertions. Should this function still be called if a test doesn’t need those assertions? The only other thing it seems to do is speed up animations by calling time.runAtSpeed(40) but I wasn’t quite able to figure out if that’s needed (and if that’s what it really does :slight_smile: ).

Thanks a bunch for answering these.

Balint

Posts: 1

Participants: 1

Read full topic

Query parameter off model attribute

$
0
0

@bmurphy wrote:

Hello,

Been trying to clean up my code with how I’m handling a query parameter on my controller and thinking there’s a better way. I have an attribute selectedLocation which is either null or a ref to an Ember Data object. I want a query parameter location tied to the selectedLocation’s ID. I’ve gotten this working in the past but it required lots of boiler plate to get it working using a setter and getter plus other stuff. Docs don’t appear to touch on this but it “feels” like something we ought to be able to do. Anyone have experience doing this? Maybe I’m just missing a simple pattern…

Thanks!

Posts: 1

Participants: 1

Read full topic

Autotracking on a Set()s or Arrays?

$
0
0

@mattmcmanus wrote:

Hey Folks, I’m trying to wrap my brain around some of the autotracking changes in Octane and having a hard time. Does autotracking work on a Set?

I want to calculate the height of a list of elements and I figured a Set would make the unique tracking easy. Take a look at the code below. I have a Set of dom elements, which is tracked. The height() method isn’t being called again when the elements changes.

  @tracked elements = new Set();

  get height() {
    if (this.elements.size === 0) {
      return 'auto';
    }
    let height = [...this.elements].reduce((sum, el) => sum + el.offsetHeight);

    return `${height}px`;
  }

  @action
  addEl(el) {
    this.elements.add(el);
  }

  @action
  removeEl(el) {
    this.elements.delete(el);
  }

Then I’m referencing height in a template:

<div
  style="flex-basis: {{this.height}}"
>
  ...

This is my first attempt at using a Set as well, so it’s possible I’m heading down the wrong path before the autotracking confusion. I’ve tried this with elements as an array and height is still not called.

Thanks for the help!

Posts: 4

Participants: 2

Read full topic

Incremental migration to new style acceptence tests

$
0
0

@Emerson wrote:

Howdy :wave:,

We have a very mature app that has lots of great acceptance tests and are in the process of trying to upgrade from Ember 2.18 to 3.4. We’re running into issues with some of our updated dependencies only supporting the new style of acceptance tests.

We prefer to do everything in small, incremental commits. Is anyone here aware of any techniques that would allow us to update one test file at a time instead of doing them all at once?

Just to be explicit, we want to move from using moduleForAcceptance to just plain module.

Thanks for any responses!

Posts: 1

Participants: 1

Read full topic

Ember computed properties with no dependencies

$
0
0

@harimath wrote:

A lot of times, I have seen computed properties used in code with no dependencies specified. I wanted to understand what is the purpose of such CP’s ?

Example;

someCP: computed({
// some code
})

Posts: 4

Participants: 2

Read full topic

Viewing all 4840 articles
Browse latest View live